Removed conflicting and redundant logic

This commit is contained in:
2025-02-10 13:39:17 +01:00
parent 9413fdbb2f
commit 592d1df9bf
7 changed files with 14 additions and 43 deletions

View File

@ -96,8 +96,17 @@ export const useGameStore = defineStore('game', {
this.connection.on('reconnect_failed', () => {
this.disconnectSocket()
})
// Listen for new date from socket
this.connection.on('date', (data: Date) => {
this.world.date = new Date(data)
})
},
disconnectSocket() {
// Remove event listeners
this.connection?.off('connect_error')
this.connection?.off('reconnect_failed')
this.connection?.off('date')
this.connection?.disconnect()
useCookies().remove('token', {