2
0
mirror of https://github.com/frappe/books.git synced 2025-01-03 15:17:30 +00:00

fix: routing issue

- re-fix the blank screen issue
- show get-started if not done
This commit is contained in:
18alantom 2023-07-17 10:43:41 +05:30 committed by Alan
parent 603f0a3be9
commit ec99727e5a
2 changed files with 6 additions and 3 deletions

View File

@ -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();

View File

@ -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);
});