Client - minor fixes
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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 () => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user