Removed conflicting and redundant logic
This commit is contained in:
@ -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', {
|
||||
|
Reference in New Issue
Block a user