Skip to content

Commit

Permalink
fix: fixing navigation between signup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Oct 23, 2024
1 parent 12564a7 commit 0c3f708
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/routes/[network]/(account)/signup/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0c3f708

Please sign in to comment.