diff --git a/src/stores/game.ts b/src/stores/game.ts index 069890b..3ed1137 100644 --- a/src/stores/game.ts +++ b/src/stores/game.ts @@ -62,11 +62,11 @@ export const useGameStore = defineStore('game', { }) }, disconnectSocket() { - if (!this.connection) return + if (this.connection) this.connection.disconnect() - this.connection.disconnect() + useCookies().remove('token') + this.connection = null - this.token = null this.user = null this.character = null @@ -74,8 +74,6 @@ export const useGameStore = defineStore('game', { this.isMovingCamera = false this.isChatOpen = false this.isUserPanelOpen = false - - useCookies().remove('token') } } })