1
0
forked from noxious/client

Removed conflicting and redundant logic

This commit is contained in:
2025-02-10 13:39:17 +01:00
parent 9413fdbb2f
commit 592d1df9bf
7 changed files with 14 additions and 43 deletions

View File

@ -1,20 +1,18 @@
<template>
<div class="absolute top-0 right-4 hidden lg:block">
<p class="text-white text-lg">{{ gameStore.world.date.toLocaleString() }}</p>
<p class="text-white text-lg">
{{ useDateFormat(gameStore.world.date ?? new Date(), 'YYYY:MM:DD HH:mm:ss') }}
</p>
</div>
</template>
<script setup lang="ts">
import { useGameStore } from '@/stores/gameStore'
import { useDateFormat } from '@vueuse/core'
import { onUnmounted } from 'vue'
const gameStore = useGameStore()
// Listen for new date from socket
gameStore.connection?.on('date', (data: Date) => {
gameStore.world.date = new Date(data)
})
onUnmounted(() => {
gameStore.connection?.off('date')
})