未验证 提交 c44f08a7 编写于 作者: Z ZQKC 提交者: GitHub

Merge pull request #8 from Candieslove/fix_node_type

fix: setTimeout problem
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册