mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-23 06:38:34 +01:00
Fix Error modal closing
This commit is contained in:
parent
27f3145740
commit
6ed54d79bb
@ -5,7 +5,7 @@
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const showModal = true
|
||||
const showModal = ref(true)
|
||||
const showDebug = computed(() => process.env.NODE_ENV === 'development')
|
||||
|
||||
const props = defineProps({
|
||||
@ -15,8 +15,19 @@
|
||||
}
|
||||
})
|
||||
|
||||
watch(showModal, (val) => {
|
||||
if (val == false) {
|
||||
exit()
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Exits the error view
|
||||
*/
|
||||
function exit() {
|
||||
window.history.length > 1 && route.name !== '404' ? router.go(-1) : router.push({ name: 'accounts' })
|
||||
window.history.length > 1 && route.name !== '404' && route.name !== 'notFound'
|
||||
? router.go(-1)
|
||||
: router.push({ name: 'accounts' })
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user