Move time updater to main layout

This commit is contained in:
Matt Isenhower 2022-09-10 20:41:12 -07:00
parent ea609494c5
commit 1c4da3d4d3
2 changed files with 11 additions and 4 deletions

View File

@ -26,16 +26,13 @@
</template>
<script setup>
import { computed, onMounted, onUnmounted } from 'vue';
import { computed } from 'vue';
import { useTimeStore } from '../stores/time';
const announceDate = new Date('2021-02-17');
const releaseDate = new Date('2022-09-09');
const time = useTimeStore();
onMounted(() => time.startUpdatingNow());
onUnmounted(() => time.stopUpdatingNow());
const totalTime = releaseDate - announceDate;
const remainingTime = computed(() => {
// Adjust the time based on midnight local time

View File

@ -32,6 +32,16 @@
</main>
</template>
<script setup>
import { onMounted, onUnmounted } from 'vue';
import { useTimeStore } from '../stores/time';
const time = useTimeStore();
onMounted(() => time.startUpdatingNow());
onUnmounted(() => time.stopUpdatingNow());
</script>
<style scoped>
.footer-links a span {
@apply text-gray-300;