Unregister PING timer when destroying client
This commit is contained in:
parent
24fe62f1de
commit
7b762b3e8a
2 changed files with 20 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue