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