fix: show modal and not the wizard.

This commit is contained in:
Darshan
2025-09-01 13:06:18 +05:30
parent b0625be54a
commit bed7916244
2 changed files with 3 additions and 13 deletions
@@ -36,7 +36,7 @@
}
</script>
<Modal bind:show title="Add credits" onSubmit={redeem} bind:error>
<Modal bind:show title="Add credits" onSubmit={redeem} bind:error size="s">
<svelte:fragment slot="description">
Apply Appwrite credits to your organization.
</svelte:fragment>
@@ -7,7 +7,6 @@
import { wizard } from '$lib/stores/wizard';
import { Query } from '@appwrite.io/console';
import { onMount } from 'svelte';
import AddCreditWizard from './addCreditWizard.svelte';
import { Button } from '$lib/elements/forms';
import AddCreditModal from './addCreditModal.svelte';
import { formatCurrency } from '$lib/helpers/numbers';
@@ -33,15 +32,6 @@
const limit = 5;
function handleCredits() {
if ($organization?.paymentMethodId || $organization?.backupPaymentMethodId) {
show = true;
} else {
wizard.start(AddCreditWizard);
reloadOnWizardClose = true;
}
}
async function request() {
if (!$organization?.$id) return;
@@ -116,7 +106,7 @@
content={formatCurrency(creditList.available)} />
</div>
{#if creditList?.total}
<Button secondary on:click={handleCredits}>
<Button secondary on:click={() => (show = true)}>
<Icon icon={IconPlus} slot="start" size="s" />
Add credits
</Button>
@@ -176,7 +166,7 @@
</div>
{/if}
{:else}
<Empty target="credits" on:click={handleCredits}>Add credits</Empty>
<Empty target="credits" on:click={() => (show = true)}>Add credits</Empty>
{/if}
{/if}
</svelte:fragment>