Unregister PING timer when destroying client
This commit is contained in:
1 parent
24fe62f1de
commit
7b762b3e8a
2 files changed
+20
-5
No files matched your search
+2
-5
@@ -548,11 +548,8 @@ export default class App extends Component {
|
||||
this.switchToChannel = params.autojoin[0];
|
||||
}
|
||||
|
||||
if (this.config.server && this.config.server.ping > 0) {
|
||||
// TODO: unregister setInterval on disconnect
|
||||
setInterval(() => {
|
||||
client.send({ command: "PING", params: ["gamja"] });
|
||||
}, this.config.server.ping * 1000);
|
||||
if (this.config.server && typeof this.config.server.ping === "number") {
|
||||
client.setPingInterval(this.config.server.ping);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user