From 617de58a92fda6d5f222ebbd6154f85281f12031 Mon Sep 17 00:00:00 2001 From: Matthew Aaron Raymer Date: Mon, 5 Dec 2022 16:52:28 +0800 Subject: [PATCH] Change to anchors with click handlers so we can run code before transitioning to next pages --- src/router/index.ts | 2 +- src/views/StartView.vue | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 45b553f7..c5d31f35 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -112,7 +112,7 @@ const router = createRouter({ router.beforeEach(async (to) => { // redirect to start page if no account - const publicPages = ["/start"]; + const publicPages = ["/start", "/account", "/import-account"]; const authRequired = !publicPages.includes(to.path); const authStore = useAccountStore(); diff --git a/src/views/StartView.vue b/src/views/StartView.vue index ad9d9085..8c3417d6 100644 --- a/src/views/StartView.vue +++ b/src/views/StartView.vue @@ -12,16 +12,16 @@

Do you already have an identity to import?

- No - - + YesYes @@ -33,5 +33,13 @@ import { Options, Vue } from "vue-class-component"; @Options({ components: {}, }) -export default class StartView extends Vue {} +export default class StartView extends Vue { + public onClickYes() { + this.$router.push({ name: "account" }); + } + + public onClickNo() { + this.$router.push({ name: "import-account" }); + } +}