mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: show modal and not the wizard.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user