Minor improvements, more work on dynamic asset loading

This commit is contained in:
2024-10-26 02:41:16 +02:00
parent 70fb732051
commit 7db2ba322c
9 changed files with 105 additions and 68 deletions

View File

@ -12,7 +12,7 @@
<script setup lang="ts">
import { useGameStore } from '@/stores/gameStore'
import Modal from '@/components/utilities/Modal.vue'
import { onBeforeMount, onBeforeUnmount, watch } from 'vue'
import { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, watch } from 'vue'
const gameStore = useGameStore()
@ -34,7 +34,7 @@ function setupNotificationListener(connection: any) {
})
}
onBeforeMount(() => {
onMounted(() => {
const connection = gameStore.connection
if (connection) {
setupNotificationListener(connection)
@ -49,7 +49,7 @@ onBeforeMount(() => {
}
})
onBeforeUnmount(() => {
onUnmounted(() => {
const connection = gameStore.connection
if (connection) {
connection.off('notification')