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 { usePlayerStore } from '@/stores/player';
|
||||||
import { useWebsocketStore } from '@/stores/websocket';
|
import { useWebsocketStore } from '@/stores/websocket';
|
||||||
import { onMounted, onBeforeMount } from 'vue'
|
import { onMounted, onBeforeMount } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
const player = usePlayerStore()
|
const player = usePlayerStore()
|
||||||
const game = useGameStore()
|
const game = useGameStore()
|
||||||
const bot = useBotStore()
|
const bot = useBotStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const websocket = useWebsocketStore()
|
const websocket = useWebsocketStore()
|
||||||
|
|
||||||
const join = () => {
|
const join = () => {
|
||||||
|
|
@ -22,7 +23,7 @@ const join = () => {
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
console.log(game.owner, game.opponent.id, player.id)
|
console.log(game.owner, game.opponent.id, player.id)
|
||||||
if (game.owner == player.id || 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
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user