fix: setTimout problem

This commit is contained in:
eilenexuzhe
2020-04-02 16:59:38 +08:00
parent e1a8081f4b
commit 922545096a
4 changed files with 7 additions and 7 deletions

View File

@@ -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);
}

View File

@@ -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);
});

View File

@@ -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 });

View File

@@ -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);
}