From ec99727e5ad4ee0f7ad121a60700c4a989206dab Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Mon, 17 Jul 2023 10:43:41 +0530 Subject: [PATCH] fix: routing issue - re-fix the blank screen issue - show get-started if not done --- src/App.vue | 4 ++-- src/router.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0fd679aa..e9360b13 100644 --- a/src/App.vue +++ b/src/App.vue @@ -232,10 +232,10 @@ export default defineComponent({ let route = '/get-started'; if (hideGetStarted || onboardingComplete) { - route = '/'; + route = localStorage.getItem('lastRoute') || '/'; } - await routeTo(localStorage.getItem('lastRoute') || route); + await routeTo(route); }, async showDbSelector(): Promise { localStorage.clear(); diff --git a/src/router.ts b/src/router.ts index bbdb721e..e8c26bad 100644 --- a/src/router.ts +++ b/src/router.ts @@ -15,7 +15,6 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'; import { historyState } from './utils/refs'; const routes: RouteRecordRaw[] = [ - { path: '/index.html', redirect: '/' }, { path: '/', component: Dashboard, @@ -128,6 +127,10 @@ router.afterEach(({ fullPath }) => { historyState.forward = !!state.forward; historyState.back = !!state.back; + if (fullPath.includes('index.html')) { + return; + } + localStorage.setItem('lastRoute', fullPath); });