chore: follow the happy path

This commit is contained in:
kolaente 2023-04-01 17:16:51 +02:00
parent 0ce150af23
commit a33e2f6c00
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 10 additions and 10 deletions

View File

@ -7,25 +7,25 @@ export function useRedirectToLastVisited() {
function getLastVisitedRoute() {
const last = getLastVisited()
if (last !== null) {
clearLastVisited()
return {
name: last.name,
params: last.params,
query: last.query,
}
if (last === null) {
return null
}
return null
clearLastVisited()
return {
name: last.name,
params: last.params,
query: last.query,
}
}
function redirectIfSaved() {
const lastRoute = getLastVisitedRoute()
if (lastRoute) {
router.push(lastRoute)
return router.push(lastRoute)
}
router.push({name: 'home'})
return router.push({name: 'home'})
}
return {