debug
This commit is contained in:
parent
a3d1c3705b
commit
f4cebd880e
|
|
@ -9,6 +9,8 @@ import { useRoute } from 'vue-router'
|
|||
const player = usePlayerStore()
|
||||
const game = useGameStore()
|
||||
const bot = useBotStore()
|
||||
const route = useRoute()
|
||||
const websocket = useWebsocketStore()
|
||||
|
||||
const join = () => {
|
||||
res = websocket.send({
|
||||
|
|
@ -20,7 +22,7 @@ const join = () => {
|
|||
onBeforeMount(() => {
|
||||
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
|
||||
route.push({ name: 'lobby', params: { gameId: game.id } })
|
||||
return
|
||||
}
|
||||
})
|
||||
|
|
@ -30,8 +32,6 @@ onMounted(() => {
|
|||
bot.$reset()
|
||||
localStorage.removeItem('game')
|
||||
localStorage.removeItem('bot')
|
||||
const route = useRoute()
|
||||
const websocket = useWebsocketStore()
|
||||
if (player.id == null) player.initPlayer()
|
||||
websocket.init(route.params.gameId)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user