mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-04 11:52:07 +08:00
fix: setTimout problem
This commit is contained in:
@@ -49,14 +49,14 @@ export class SearchAndFilter extends React.Component<any, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public handleVisble = (type: string) => {
|
public handleVisble = (type: string) => {
|
||||||
if (this.timer) clearTimeout(this.timer);
|
if (this.timer) window.clearTimeout(this.timer);
|
||||||
setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
this.setState({ [type]: true });
|
this.setState({ [type]: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleUnVisble = (type: string) => {
|
public handleUnVisble = (type: string) => {
|
||||||
this.timer = setTimeout(() => {
|
this.timer = window.setTimeout(() => {
|
||||||
this.setState({ [type]: false });
|
this.setState({ [type]: false });
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class ResetOffset extends React.Component<any> {
|
|||||||
consume.offsetPartition(Object.assign({ timestamp: +moment(timestamp).format('x') }, topic.currentGroup))
|
consume.offsetPartition(Object.assign({ timestamp: +moment(timestamp).format('x') }, topic.currentGroup))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message.success('重置时间成功');
|
message.success('重置时间成功');
|
||||||
setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
@@ -28,7 +28,7 @@ class ResetOffset extends React.Component<any> {
|
|||||||
public submitPartiton = () => {
|
public submitPartiton = () => {
|
||||||
consume.offsetPartition(topic.currentGroup, 1).then(() => {
|
consume.offsetPartition(topic.currentGroup, 1).then(() => {
|
||||||
message.success('重置分区成功');
|
message.success('重置分区成功');
|
||||||
setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Topic extends React.Component<any> {
|
|||||||
this.setState({ loading: true });
|
this.setState({ loading: true });
|
||||||
createTopic(values).then(data => {
|
createTopic(values).then(data => {
|
||||||
notification.success({ message: '申请Topic成功' });
|
notification.success({ message: '申请Topic成功' });
|
||||||
setTimeout(() => location.assign('/user/my_order'), 500);
|
window.setTimeout(() => location.assign('/user/my_order'), 500);
|
||||||
modal.close();
|
modal.close();
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class Cluster {
|
|||||||
return getRebalanceStatus(clusterId).then((type) => {
|
return getRebalanceStatus(clusterId).then((type) => {
|
||||||
this.setLeaderStatus(type);
|
this.setLeaderStatus(type);
|
||||||
if (type === 'RUNNING') {
|
if (type === 'RUNNING') {
|
||||||
setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
this.getRebalance(clusterId);
|
this.getRebalance(clusterId);
|
||||||
}, 1000 * 2);
|
}, 1000 * 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user