From a13098a4a73f4e36f7a527a453da3b525f727d03 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Thu, 12 Jun 2025 22:18:38 +1000 Subject: [PATCH] Fix crash when opened with no file open --- src/main.ts | 9 +++------ src/pages/HomeView.vue | 14 ++++++++------ src/pages/NoFileView.vue | 9 ++++++++- src/plugin.ts | 22 ++++++++++++++++++++-- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/main.ts b/src/main.ts index 772c91d..0234b3c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,7 @@ import { RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'; import App from './App.vue'; import { db } from './db.ts'; import { handleCriticalError } from './error.ts'; -import austax from './plugins/austax/plugin.ts'; +import { initPlugins } from './plugin.ts'; async function initApp() { // Init state @@ -58,16 +58,13 @@ async function initApp() { { path: '/trial-balance', name: 'trial-balance', component: () => import('./reports/TrialBalanceReport.vue') }, ]; - // Init plugin routes - if (db.metadata.plugins.indexOf('austax') >= 0) { - routes.push(...austax.getRoutes()); - } - const router = createRouter({ history: createWebHistory(), routes, }); + initPlugins(router); + // Create Vue app createApp(App).use(router).mount('#app'); } diff --git a/src/pages/HomeView.vue b/src/pages/HomeView.vue index 0d72151..f9c89d5 100644 --- a/src/pages/HomeView.vue +++ b/src/pages/HomeView.vue @@ -17,7 +17,7 @@ --> diff --git a/src/pages/NoFileView.vue b/src/pages/NoFileView.vue index 3a98df4..07e73b0 100644 --- a/src/pages/NoFileView.vue +++ b/src/pages/NoFileView.vue @@ -1,5 +1,5 @@