From b5aec17dd415ae842360b761fa51b56127182cd1 Mon Sep 17 00:00:00 2001 From: Aleksandr Zaitsev Date: Sun, 21 Jul 2024 21:28:24 +0300 Subject: [PATCH] debug --- src/stores/websocket.js | 5 ----- src/views/JoinView.vue | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stores/websocket.js b/src/stores/websocket.js index 7d26421..68e2881 100644 --- a/src/stores/websocket.js +++ b/src/stores/websocket.js @@ -12,11 +12,6 @@ export const useWebsocketStore = defineStore("websocket", { init(gameId) { const player = usePlayerStore() const game = useGameStore() - console.log(game, game.opponent.id, player.id) - if (window.location.pathname != '/lobby/' + game.id && (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); diff --git a/src/views/JoinView.vue b/src/views/JoinView.vue index c381dec..1305d8c 100644 --- a/src/views/JoinView.vue +++ b/src/views/JoinView.vue @@ -12,6 +12,11 @@ const player = usePlayerStore() const game = useGameStore() const bot = useBotStore() +if (game.owner == player.id || game.opponent.id == player.id) { + window.location.href = window.location.origin + '/lobby/' + game.id + return +} + game.$reset() bot.$reset() localStorage.removeItem('game')