debug
This commit is contained in:
parent
f4cebd880e
commit
5d51d058ab
|
|
@ -4,12 +4,13 @@ import { useGameStore } from '@/stores/game';
|
|||
import { usePlayerStore } from '@/stores/player';
|
||||
import { useWebsocketStore } from '@/stores/websocket';
|
||||
import { onMounted, onBeforeMount } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
const player = usePlayerStore()
|
||||
const game = useGameStore()
|
||||
const bot = useBotStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const websocket = useWebsocketStore()
|
||||
|
||||
const join = () => {
|
||||
|
|
@ -22,7 +23,7 @@ const join = () => {
|
|||
onBeforeMount(() => {
|
||||
console.log(game.owner, game.opponent.id, player.id)
|
||||
if (game.owner == player.id || game.opponent.id == player.id) {
|
||||
route.push({ name: 'lobby', params: { gameId: game.id } })
|
||||
router.replace({ name: 'lobby', params: { gameId: game.id } })
|
||||
return
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user