From 8e7b90e741f4b8a817e5330d30a9b28a056df1e4 Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Tue, 13 Jan 2026 16:39:39 -0800 Subject: [PATCH 1/9] Add accountId to dashboard URL --- app/pages/dashboard.vue | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/app/pages/dashboard.vue b/app/pages/dashboard.vue index d7d3e5b..95f2212 100644 --- a/app/pages/dashboard.vue +++ b/app/pages/dashboard.vue @@ -1,11 +1,12 @@ From 13b31821e90ac6c6ae1685e9be39409f77b1f576 Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Tue, 13 Jan 2026 16:39:43 -0800 Subject: [PATCH 2/9] 3.0.19 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2946980..70c41e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bc-registry", - "version": "3.0.18", + "version": "3.0.19", "private": true, "type": "module", "scripts": { From d92bf30d339284aa9000f03c1f9164ed349bf244 Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Wed, 14 Jan 2026 15:11:20 -0800 Subject: [PATCH 3/9] Add optional account id route and keep URL in sync --- .../{dashboard.vue => dashboard/[[id]].vue} | 71 ++++++++++++------- 1 file changed, 47 insertions(+), 24 deletions(-) rename app/pages/{dashboard.vue => dashboard/[[id]].vue} (84%) diff --git a/app/pages/dashboard.vue b/app/pages/dashboard/[[id]].vue similarity index 84% rename from app/pages/dashboard.vue rename to app/pages/dashboard/[[id]].vue index 95f2212..d3e6e9b 100644 --- a/app/pages/dashboard.vue +++ b/app/pages/dashboard/[[id]].vue @@ -1,12 +1,14 @@ From e38d4603f89a3faf2243c7271fa185dde3df785e Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Wed, 14 Jan 2026 15:18:41 -0800 Subject: [PATCH 4/9] lint fix --- app/pages/dashboard/[[id]].vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index d3e6e9b..defcc05 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -19,9 +19,9 @@ definePageMeta({ }) const isSbcStaff = ref(false) -const helpHref = - 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' + - 'permits-licences/news-updates/modernization-updates/modernization-resources' +const helpHref + = 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' + + 'permits-licences/news-updates/modernization-updates/modernization-resources' /** * Sync URL with accountStore.currentAccount.id @@ -34,9 +34,12 @@ const helpHref = watch( () => accountStore.currentAccount.id, (newId) => { - if (!newId) return - const routeId = - typeof route.params.id === 'string' + if (!newId) { + return + } + + const routeId + = typeof route.params.id === 'string' ? route.params.id : undefined From 284c705bf8ac74883a4f9f811454f57ec13fec92 Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Wed, 14 Jan 2026 15:22:18 -0800 Subject: [PATCH 5/9] tweaks --- app/pages/dashboard/[[id]].vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index defcc05..69f70e7 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -19,10 +19,8 @@ definePageMeta({ }) const isSbcStaff = ref(false) -const helpHref - = 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' - + 'permits-licences/news-updates/modernization-updates/modernization-resources' - +const helpHref = 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' + + 'permits-licences/news-updates/modernization-updates/modernization-resources' /** * Sync URL with accountStore.currentAccount.id * From 501ce1f8fcb36e326fd8c01fa42780816a709d6b Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Wed, 14 Jan 2026 19:12:44 -0800 Subject: [PATCH 6/9] small tweak --- app/pages/dashboard/[[id]].vue | 42 ++++++++-------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index 69f70e7..8a071ce 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -7,7 +7,6 @@ const { $authApi } = useNuxtApp() const { clearLoginRedirectUrl, setLogoutRedirectUrl, kcUser } = useKeycloak() const rtc = useRuntimeConfig().public -const router = useRouter() const route = useRoute() useHead({ @@ -21,38 +20,17 @@ definePageMeta({ const isSbcStaff = ref(false) const helpHref = 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' + 'permits-licences/news-updates/modernization-updates/modernization-resources' -/** - * Sync URL with accountStore.currentAccount.id - * - * Rules: - * 1. If store id changes -> update URL - * 2. If URL has no id but store has one -> add it - * 3. If store has no id -> do nothing - */ -watch( - () => accountStore.currentAccount.id, - (newId) => { - if (!newId) { - return - } - - const routeId - = typeof route.params.id === 'string' - ? route.params.id - : undefined +// Sync URL <-> accountStore.currentAccount.id +const routeId = typeof route.params.id === 'string' ? Number(route.params.id) : undefined +if (routeId && routeId !== accountStore.currentAccount.id) { + accountStore.switchCurrentAccount(routeId) +} - if (routeId !== newId) { - router.replace({ - name: route.name as string, - params: { - ...route.params, - id: newId - } - }) - } - }, - { immediate: true } -) +watch(() => accountStore.currentAccount.id, (newId) => { + if (newId) { + window.history.replaceState({}, '', localePath(`/dashboard/${newId}`)) + } +}, { immediate: true }) const { data: userProducts, status, error } = await useLazyAsyncData( 'user-products', From c0195a02d593f409f57eb5dd5bf26d1a1e3e65f5 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Wed, 14 Jan 2026 19:18:21 -0800 Subject: [PATCH 7/9] Small tweak --- app/pages/dashboard/[[id]].vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index 8a071ce..0fb688f 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -21,9 +21,9 @@ const isSbcStaff = ref(false) const helpHref = 'https://www2.gov.bc.ca/gov/content/employment-business/business/managing-a-business/' + 'permits-licences/news-updates/modernization-updates/modernization-resources' // Sync URL <-> accountStore.currentAccount.id -const routeId = typeof route.params.id === 'string' ? Number(route.params.id) : undefined -if (routeId && routeId !== accountStore.currentAccount.id) { - accountStore.switchCurrentAccount(routeId) +const routeAccountId = Number(route.params.id) +if (routeAccountId !== accountStore.currentAccount.id && Number.isFinite(routeAccountId)) { + accountStore.switchCurrentAccount(routeAccountId) } watch(() => accountStore.currentAccount.id, (newId) => { From 9697e797481d22f3021646a86809fda08c9463c4 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Wed, 14 Jan 2026 19:20:21 -0800 Subject: [PATCH 8/9] clean up! --- app/pages/dashboard/[[id]].vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index 0fb688f..bef8721 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -22,7 +22,7 @@ const helpHref = 'https://www2.gov.bc.ca/gov/content/employment-business/busines + 'permits-licences/news-updates/modernization-updates/modernization-resources' // Sync URL <-> accountStore.currentAccount.id const routeAccountId = Number(route.params.id) -if (routeAccountId !== accountStore.currentAccount.id && Number.isFinite(routeAccountId)) { +if (routeAccountId > 0 && Number.isFinite(routeAccountId && routeAccountId !== accountStore.currentAccount.id)) { accountStore.switchCurrentAccount(routeAccountId) } From 8cb3ba73330c187305860826f187b16000d08ba2 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Wed, 14 Jan 2026 19:20:38 -0800 Subject: [PATCH 9/9] clean up! --- app/pages/dashboard/[[id]].vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/dashboard/[[id]].vue b/app/pages/dashboard/[[id]].vue index bef8721..72ef607 100644 --- a/app/pages/dashboard/[[id]].vue +++ b/app/pages/dashboard/[[id]].vue @@ -22,7 +22,7 @@ const helpHref = 'https://www2.gov.bc.ca/gov/content/employment-business/busines + 'permits-licences/news-updates/modernization-updates/modernization-resources' // Sync URL <-> accountStore.currentAccount.id const routeAccountId = Number(route.params.id) -if (routeAccountId > 0 && Number.isFinite(routeAccountId && routeAccountId !== accountStore.currentAccount.id)) { +if (routeAccountId > 0 && Number.isFinite(routeAccountId) && routeAccountId !== accountStore.currentAccount.id) { accountStore.switchCurrentAccount(routeAccountId) }