Client - minor fixes

This commit is contained in:
Sam 2022-09-19 14:00:49 +02:00
parent b216900031
commit 6e04791b2d
2 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,6 @@
<template>
<Error
v-if="errorDisplayed"
title="404"
:message="$t(`error.NOT_FOUND.${target}`)"
:button-text="$t('common.HOME')"
@ -7,7 +8,7 @@
</template>
<script setup lang="ts">
import { toRefs, withDefaults } from 'vue'
import { Ref, onMounted, ref, toRefs, withDefaults, onUnmounted } from 'vue'
import Error from '@/components/Common/Error.vue'
interface Props {
@ -17,4 +18,20 @@
target: 'PAGE',
})
const { target } = toRefs(props)
const timer = ref<number | undefined>()
const errorDisplayed: Ref<boolean> = ref(false)
onMounted(() => displayError())
function displayError() {
timer.value = setTimeout(() => {
errorDisplayed.value = true
}, 500)
}
onUnmounted(() => {
if (timer.value) {
clearTimeout(timer.value)
}
})
</script>

View File

@ -145,6 +145,7 @@
import {
ComputedRef,
computed,
onUnmounted,
reactive,
ref,
toRefs,
@ -262,6 +263,8 @@
formData.password = ''
}
onUnmounted(() => store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES))
watch(
() => route.path,
async () => {