mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: payment modal not closing.
This commit is contained in:
@@ -19,9 +19,9 @@
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const card = await submitStripeCard(name, page?.params?.organization ?? null);
|
||||
show = false;
|
||||
invalidate(Dependencies.PAYMENT_METHODS);
|
||||
dispatch('submit', card);
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: 'A new payment method has been added to your account'
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: if (backdrop) {
|
||||
$: if (backdrop && show && !document.body.contains(backdrop)) {
|
||||
document.body.appendChild(backdrop);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function submitStripeCard(name: string, organizationId?: string) {
|
||||
}
|
||||
|
||||
// Element needs to be submitted before confirming the setup intent
|
||||
elements.submit();
|
||||
await elements.submit();
|
||||
|
||||
const baseUrl = 'https://cloud.appwrite.io/console';
|
||||
const accountUrl = `${baseUrl}/account/payments?clientSecret=${clientSecret}`;
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
</Typography.Text>
|
||||
</Tooltip>
|
||||
</Layout.Stack>
|
||||
<ActionMenu.Root slot="tooltip">
|
||||
<ActionMenu.Root slot="tooltip" let:toggle>
|
||||
{#if $paymentMethods.total}
|
||||
{#each filteredPaymentMethods as paymentMethod}
|
||||
<ActionMenu.Item.Button
|
||||
@@ -245,7 +245,10 @@
|
||||
<Divider />
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconPlus}
|
||||
on:click={() => (showPayment = true)}>
|
||||
on:click={(e) => {
|
||||
toggle(e);
|
||||
showPayment = true;
|
||||
}}>
|
||||
Add new payment method
|
||||
</ActionMenu.Item.Button>
|
||||
</ActionMenu.Root>
|
||||
@@ -262,7 +265,7 @@
|
||||
<Button secondary icon on:click={toggle}>
|
||||
<Icon icon={IconPlus} size="s" />
|
||||
</Button>
|
||||
<ActionMenu.Root slot="tooltip">
|
||||
<ActionMenu.Root slot="tooltip" let:toggle>
|
||||
{#if $paymentMethods.total}
|
||||
{#each filteredPaymentMethods as paymentMethod}
|
||||
<ActionMenu.Item.Button
|
||||
@@ -277,7 +280,10 @@
|
||||
<Divider />
|
||||
<ActionMenu.Item.Button
|
||||
leadingIcon={IconPlus}
|
||||
on:click={() => (showPayment = true)}>
|
||||
on:click={(e) => {
|
||||
toggle(e);
|
||||
showPayment = true;
|
||||
}}>
|
||||
Add new payment method
|
||||
</ActionMenu.Item.Button>
|
||||
</ActionMenu.Root>
|
||||
|
||||
Reference in New Issue
Block a user