提交 92254509 编写于 作者: E eilenexuzhe

fix: setTimout problem

上级 e1a8081f
...@@ -49,14 +49,14 @@ export class SearchAndFilter extends React.Component<any, IState> { ...@@ -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> { ...@@ -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> { ...@@ -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> { ...@@ -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 { ...@@ -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);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册