From 0c3f7086c7f203c8c85ed6a5652d92972f7ee3b6 Mon Sep 17 00:00:00 2001 From: dafuga Date: Wed, 23 Oct 2024 16:07:22 -0700 Subject: [PATCH] fix: fixing navigation between signup steps --- src/routes/[network]/(account)/signup/+layout.svelte | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/routes/[network]/(account)/signup/+layout.svelte b/src/routes/[network]/(account)/signup/+layout.svelte index b572afbf0..b5680d89e 100644 --- a/src/routes/[network]/(account)/signup/+layout.svelte +++ b/src/routes/[network]/(account)/signup/+layout.svelte @@ -20,30 +20,31 @@ let steps: SignupStep[] = $derived([ { title: 'Get Started', - path: `/${locale}/${data.network}/signup` + path: `/${data.network}/signup` }, { title: 'Select Environment', - path: `/${locale}/${data.network}/signup/wallets` + path: `/${data.network}/signup/wallets` }, { title: 'Select Wallet', - path: `/${locale}/${data.network}/signup/wallets/${getWalletTypeFromPath($page.url.pathname)?.type}` + path: `/${data.network}/signup/wallets/${getWalletTypeFromPath($page.url.pathname)?.type}` }, { title: 'Setup Wallet', - path: `/${locale}/${data.network}/signup/wallets/${getWalletTypeFromPath($page.url.pathname)?.type}/${getWalletNameFromPath($page.url.pathname)?.toLowerCase()}` + path: `/${data.network}/signup/wallets/${getWalletTypeFromPath($page.url.pathname)?.type}/${getWalletNameFromPath($page.url.pathname)?.toLowerCase()}` } ]); function getCurrentStep() { return steps.find((step) => { - return $page.url.pathname === step.path; + return $page.url.pathname.replace(`/${locale}`, '') === step.path; }); } function isFutureStep(stepIndex: number) { const currentStep = getCurrentStep(); + console.log({ currentStep, stepIndex }); if (!currentStep) return false; return stepIndex > steps.indexOf(currentStep); }