Skip to content

Commit

Permalink
Inform the user to first add a billing address to their account
Browse files Browse the repository at this point in the history
  • Loading branch information
ernstmul committed Dec 18, 2024
1 parent 4aa74ce commit d9a8472
Showing 1 changed file with 11 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,18 @@
</FormList>
</RadioBoxes>
</FormList>
{:else}
<Alert
>There are no billing addresses linked to your account, please <a
href={`${base}/account/payments`}
class="link">add one</a> first</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 d9a8472

Please sign in to comment.