fix: back nav from change-plan.

This commit is contained in:
Darshan
2025-06-29 19:51:47 +05:30
parent 223ef634d4
commit 035afa78ec
4 changed files with 12 additions and 12 deletions
+4 -2
View File
@@ -50,7 +50,7 @@
if (confirmExit) {
showExitModal = true;
} else {
goto(href);
goBack();
trackEvent('wizard_exit', {
from: 'escape'
});
@@ -58,6 +58,8 @@
}
}
const goBack = () => goto(href);
onMount(() => ($isNewWizardStatusOpen = true));
onDestroy(() => ($isNewWizardStatusOpen = false));
@@ -77,7 +79,7 @@
if (confirmExit) {
showExitModal = true;
} else {
goto(href);
goBack();
trackEvent('wizard_exit', {
from: 'button'
});
@@ -271,11 +271,7 @@
<title>Change plan - Appwrite</title>
</svelte:head>
<Wizard
title="Change plan"
href={`${base}/organization-${page.params.organization}`}
bind:showExitModal
confirmExit>
<Wizard title="Change plan" href={previousPage} bind:showExitModal confirmExit>
<Form bind:this={formComponent} onSubmit={handleSubmit} bind:isSubmitting>
<Layout.Stack gap="xxl">
<Fieldset legend="Select plan">
@@ -52,7 +52,7 @@
</Button>
</Layout.Stack>
</div>
<Paginator items={members.memberships} hideFooter={members?.total <= 5}>
<Paginator items={members?.memberships} hideFooter={members?.total <= 5}>
{#snippet children(paginatedItems: typeof members.memberships)}
<Table.Root columns={2} let:root>
<svelte:fragment slot="header" let:root>
@@ -7,11 +7,13 @@
import { createTimeUnitPair } from '$lib/helpers/unit';
import { addNotification } from '$lib/stores/notifications';
import { sdk } from '$lib/stores/sdk';
import { project } from '../../store';
import { project as projectStore } from '../../store';
import { Layout } from '@appwrite.io/pink-svelte';
import { page } from '$app/state';
const { value, unit, baseValue, units } = createTimeUnitPair($project?.authDuration);
const options = units.map((v) => ({ label: v.name, value: v.name }));
const project = $derived($projectStore ?? page.data?.project);
const { value, unit, baseValue, units } = $derived(createTimeUnitPair(project?.authDuration));
const options = $derived(units.map((v) => ({ label: v.name, value: v.name })));
async function updateSessionLength() {
try {
@@ -43,7 +45,7 @@
</Layout.Stack>
</svelte:fragment>
<svelte:fragment slot="actions">
<Button disabled={$baseValue === $project.authDuration} on:click={updateSessionLength}>
<Button disabled={$baseValue === project.authDuration} on:click={updateSessionLength}>
Update
</Button>
</svelte:fragment>