Skip to content

Commit

Permalink
fix: routing issue
Browse files Browse the repository at this point in the history
- re-fix the blank screen issue
- show get-started if not done
  • Loading branch information
18alantom committed Jul 17, 2023
1 parent 603f0a3 commit ec99727
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
localStorage.clear();
Expand Down
5 changes: 4 additions & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
});

Expand Down

0 comments on commit ec99727

Please sign in to comment.