diff --git a/frontend/src/api/chat/ChatClientDirectOpenLive.js b/frontend/src/api/chat/ChatClientDirectOpenLive.js index ecd45ed..e67100f 100644 --- a/frontend/src/api/chat/ChatClientDirectOpenLive.js +++ b/frontend/src/api/chat/ChatClientDirectOpenLive.js @@ -24,10 +24,6 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase { } stop() { - if (this.gameHeartbeatTimerId) { - window.clearTimeout(this.gameHeartbeatTimerId) - this.gameHeartbeatTimerId = null - } this.endGame() super.stop() @@ -52,6 +48,11 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase { content: '房间连接已断开' })) + if (this.gameHeartbeatTimerId) { + window.clearTimeout(this.gameHeartbeatTimerId) + this.gameHeartbeatTimerId = null + } + super.onWsClose() }