From e3e4b8a5634cd95a74dea2e87eedf8d27228d62d Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 11 Apr 2023 18:40:22 +0200 Subject: [PATCH] fix: follow the happy path --- src/composables/useRedirectToLastVisited.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/composables/useRedirectToLastVisited.ts b/src/composables/useRedirectToLastVisited.ts index 9fc2f8fd..29e9ad48 100644 --- a/src/composables/useRedirectToLastVisited.ts +++ b/src/composables/useRedirectToLastVisited.ts @@ -21,11 +21,11 @@ export function useRedirectToLastVisited() { function redirectIfSaved() { const lastRoute = getLastVisitedRoute() - if (lastRoute) { - return router.push(lastRoute) + if (!lastRoute) { + return router.push({name: 'home'}) } - return router.push({name: 'home'}) + return router.push(lastRoute) } return {