Commit 9648e5ba by 姜雷

关闭socket时取消计时器

parent ec432609
...@@ -224,7 +224,7 @@ class Shower extends Component { ...@@ -224,7 +224,7 @@ class Shower extends Component {
} }
closeDeviceSocket() { closeDeviceSocket() {
const { task } = this.state; const { task, timer } = this.state;
console.log('in close', task); console.log('in close', task);
if (task) { if (task) {
task.close({ task.close({
...@@ -236,6 +236,9 @@ class Shower extends Component { ...@@ -236,6 +236,9 @@ class Shower extends Component {
}, },
}); });
} }
if (timer) {
clearTimeout(timer);
}
} }
checkUsingDevice() { checkUsingDevice() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment