From a55dce6f3d101de8a668b248202d6faa263f2e59 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Fri, 8 May 2026 20:02:34 +0800 Subject: [PATCH] fix(dev): align notification debug with non-production Capacitor builds Add includeDevToolkitRoutes (vite dev or MODE !== production) and use it from the router, AccountViewView, and NotificationDebugView so the debug screen matches dev-notifications registration after vite build. Update the gated banner copy to refer to production Vite builds. --- src/router/index.ts | 5 +---- src/utils/includeDevToolkitRoutes.ts | 6 ++++++ src/views/AccountViewView.vue | 7 +++---- src/views/dev/NotificationDebugView.vue | 7 +++++-- 4 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 src/utils/includeDevToolkitRoutes.ts diff --git a/src/router/index.ts b/src/router/index.ts index a09cc627..3baa6d0e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -10,10 +10,7 @@ import { retrieveAccountDids, generateSaveAndActivateIdentity, } from "../libs/util"; - -/** Matches AccountViewView dev toolkit links: `vite build` has DEV false unless MODE is production. */ -const includeDevToolkitRoutes = - import.meta.env.DEV || import.meta.env.MODE !== "production"; +import { includeDevToolkitRoutes } from "../utils/includeDevToolkitRoutes"; const routes: Array = [ { diff --git a/src/utils/includeDevToolkitRoutes.ts b/src/utils/includeDevToolkitRoutes.ts new file mode 100644 index 00000000..14308ce0 --- /dev/null +++ b/src/utils/includeDevToolkitRoutes.ts @@ -0,0 +1,6 @@ +/** + * True for `vite dev` and for `vite build` when mode is not `production` + * (e.g. `--mode capacitor`, `--mode test`). Use for dev-only routes and UI. + */ +export const includeDevToolkitRoutes = + import.meta.env.DEV || import.meta.env.MODE !== "production"; diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 82d4f060..24f381a1 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -742,7 +742,7 @@ > Logs - + - This view is only available in development builds. + This screen is hidden in production Vite builds (for example when built + with + --mode production). @@ -25,11 +27,12 @@