debug
This commit is contained in:
parent
7f7f2ed9c5
commit
48d9cb65ef
|
|
@ -13,29 +13,23 @@ const route = useRoute()
|
|||
const router = useRouter()
|
||||
const websocket = useWebsocketStore()
|
||||
|
||||
const join = () => {
|
||||
res = websocket.send({
|
||||
action: 'join',
|
||||
from: player.id
|
||||
})
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
console.log(game.owner, game.opponent.id, player.id, game.owner == player.id || game.opponent.id == player.id)
|
||||
if (game.owner == player.id || game.opponent.id == player.id) {
|
||||
router.replace({ name: 'lobby', params: { gameId: game.id } })
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (game.owner == player.id || game.opponent.id == player.id) {
|
||||
router.replace({ name: 'lobby', params: { gameId: game.id } })
|
||||
} else {
|
||||
game.$reset()
|
||||
bot.$reset()
|
||||
localStorage.removeItem('game')
|
||||
localStorage.removeItem('bot')
|
||||
if (player.id == null) player.initPlayer()
|
||||
websocket.init(route.params.gameId)
|
||||
})
|
||||
}
|
||||
|
||||
const join = () => {
|
||||
websocket.send({
|
||||
action: 'join',
|
||||
from: player.id
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user