Zone editor UX improvements, possibly fixed login issue after registration

This commit is contained in:
2024-07-21 22:48:16 +02:00
parent 12cd7b667a
commit 338d4d312b
5 changed files with 21 additions and 14 deletions

View File

@ -25,7 +25,6 @@
</form>
</div>
</div>
<audio ref="bgm" id="bgm" src="/assets/music/bgm.mp3" loop autoplay></audio>
</template>
<script setup lang="ts">
@ -35,12 +34,6 @@ import { useNotificationStore } from '@/stores/notifications'
import { useGameStore } from '@/stores/game'
import { useAssetStore } from '@/stores/assets'
const bgm = ref('bgm')
if (bgm.value.paused) {
addEventListener('click', () => bgm.value.play())
addEventListener('keydown', () => bgm.value.play())
}
const gameStore = useGameStore()
const notifications = useNotificationStore()
const assetStore = useAssetStore()
@ -73,7 +66,7 @@ async function loginFunc() {
}
gameStore.setToken(response.token)
await gameStore.initConnection()
gameStore.initConnection()
}
async function registerFunc() {
@ -91,7 +84,6 @@ async function registerFunc() {
return
}
gameStore.setToken(response.token)
await gameStore.initConnection()
await loginFunc()
}
</script>