Skip to content

Commit

Permalink
Merge pull request #1572 from appwrite/fix-update-payment-address-wit…
Browse files Browse the repository at this point in the history
…h-payment-address

Inform the user to first add a billing address to their account
  • Loading branch information
ernstmul authored Dec 20, 2024
2 parents a619baf + f7d40f7 commit 0c084db
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { Modal, RadioBoxes } from '$lib/components';
import { Alert, Modal, RadioBoxes } from '$lib/components';
import { Button, FormItem, FormList, InputSelect, InputText } from '$lib/elements/forms';
import { sdk } from '$lib/stores/sdk';
import { organization } from '$lib/stores/organization';
Expand All @@ -10,6 +10,7 @@
import { addNotification } from '$lib/stores/notifications';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Pill } from '$lib/elements';
import { base } from '$app/paths';
export let show = false;
let addresses: AddressesList;
Expand Down Expand Up @@ -185,10 +186,21 @@
</FormList>
</RadioBoxes>
</FormList>
{:else}
<Alert
buttons={[
{
slot: 'Add address',
href: `${base}/account/payments`
}
]}>There are no billing addresses linked to your account.</Alert>
{/if}
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button secondary submit disabled={selectedAddress === $organization.billingAddressId}>
<Button
secondary
submit
disabled={selectedAddress === $organization.billingAddressId || !addresses?.total}>
Save
</Button>
</svelte:fragment>
Expand Down

0 comments on commit 0c084db

Please sign in to comment.