diff --git a/src/router/index.ts b/src/router/index.ts index a3d4907f..0b9aa52b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,35 +2,11 @@ import { createRouter, createWebHistory, createMemoryHistory, - NavigationGuardNext, RouteLocationNormalized, RouteRecordRaw, } from "vue-router"; -import { accountsDBPromise } from "../db/index"; import { logger } from "../utils/logger"; -/** - * - * @param to :RouteLocationNormalized - * @param from :RouteLocationNormalized - * @param next :NavigationGuardNext - */ -const enterOrStart = async ( - to: RouteLocationNormalized, - from: RouteLocationNormalized, - next: NavigationGuardNext, -) => { - // one of the few times we use accountsDBPromise directly; try to avoid more usage - const accountsDB = await accountsDBPromise; - const num_accounts = await accountsDB.accounts.count(); - - if (num_accounts > 0) { - next(); - } else { - next({ name: "start" }); - } -}; - const routes: Array = [ { path: "/account", @@ -216,7 +192,6 @@ const routes: Array = [ path: "/projects", name: "projects", component: () => import("../views/ProjectsView.vue"), - beforeEnter: enterOrStart, }, { path: "/quick-action-bvc",