From 65381e103c82c0bfc262525b5b2260e255f171bf Mon Sep 17 00:00:00 2001 From: Matthew Aaron Raymer Date: Wed, 21 Dec 2022 18:02:19 +0800 Subject: [PATCH] Flesh out a bit more of the import and also refactor the router --- src/router/index.ts | 20 +++++------ src/views/ImportAccountView.vue | 64 +++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 67cafda..9697d48 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -115,22 +115,20 @@ router.beforeEach(async (to, from, next) => { const publicPages = ["/start", "/account", "/import-account"]; const isPublic = publicPages.includes(to.path); const appStore = useAppStore(); - let return_path = "/start"; - if (to.path === "/" && appStore.condition == "registered") { - return_path = "/account"; - } - if (isPublic) { + console.log(to); + if (to.path === "/" && appStore.condition === "registered") { + next({ path: "/account" }); + } else if (isPublic) { switch (appStore.condition) { - case "uninitialized": - return_path = ""; - break; case "registered": next(); break; + default: + next(); + break; } - } - if (return_path == "") { - return; + } else if (appStore.condition === "uninitialized") { + next({ path: "/start" }); } else { next(); } diff --git a/src/views/ImportAccountView.vue b/src/views/ImportAccountView.vue index dff34e8..866c376 100644 --- a/src/views/ImportAccountView.vue +++ b/src/views/ImportAccountView.vue @@ -14,49 +14,59 @@ -
-

- Enter your seed phrase below to import your identity on this device. -

- -
- - -
-
+

+ Enter your seed phrase below to import your identity on this device. +

+ +
+ + +