From f53a0e284797998425958ceca80150f40f5b4562 Mon Sep 17 00:00:00 2001 From: Aleksandr Zaitsev Date: Sun, 21 Jul 2024 21:19:29 +0300 Subject: [PATCH] debug --- src/stores/websocket.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stores/websocket.js b/src/stores/websocket.js index 1cbc412..f79666f 100644 --- a/src/stores/websocket.js +++ b/src/stores/websocket.js @@ -12,7 +12,11 @@ export const useWebsocketStore = defineStore("websocket", { init(gameId) { const player = usePlayerStore() const game = useGameStore() - if (game.owner == player.id || game.opponent.id == player.id) window.location.href = window.location.origin + '/lobby/' + game.id + console.log(game.owner, game.opponent.id, player.id) + if (game.owner == player.id || game.opponent.id == player.id) { + window.location.href = window.location.origin + '/lobby/' + game.id + return + } this.connection = new WebSocket(connectionUrl + "?gameId=" + gameId + "&playerId=" + player.id); this.connection.onopen = function (event) { console.log(event);