feat/FRO-31: Added ingame (#20)
Force push of Janis ingame changes Co-authored-by: Janis <janis.e.20@gmx.de> Reviewed-on: #20
This commit is contained in:
33
src/views/Game.vue
Normal file
33
src/views/Game.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import {useWebSocket} from "@/composables/useWebsocket.ts";
|
||||
import {useIngame} from "@/composables/useIngame.ts";
|
||||
import Ingame from "@/components/Ingame.vue";
|
||||
import {useUserInfo} from "@/composables/useUserInfo.ts";
|
||||
import router from "@/router";
|
||||
|
||||
const wb = useWebSocket()
|
||||
const ig = useIngame()
|
||||
const ui = useUserInfo()
|
||||
|
||||
ui.requestState()
|
||||
if (ui.gameId) {
|
||||
ig.requestGame(ui.gameId)
|
||||
wb.connect()
|
||||
} else {
|
||||
router.replace("/")
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="lobby-background">
|
||||
<Ingame v-if="ig.state === 'InGame'" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.lobby-background {
|
||||
background-color: var(--body-background-color);
|
||||
width: 100%;
|
||||
min-height:100vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user