From 094aefb2b40b81b3215258cc2e57012602a58d83 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 18 Oct 2023 16:42:52 +0200 Subject: [PATCH] fix: address modal, small fixes --- .../account/payments/addressModal.svelte | 20 +++++++++---------- .../organization-[organization]/+page.svelte | 4 +--- .../project-[project]/functions/+page.svelte | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/routes/console/account/payments/addressModal.svelte b/src/routes/console/account/payments/addressModal.svelte index 118a16ce0..839b2e75c 100644 --- a/src/routes/console/account/payments/addressModal.svelte +++ b/src/routes/console/account/payments/addressModal.svelte @@ -3,7 +3,7 @@ import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { Modal } from '$lib/components'; import { Dependencies } from '$lib/constants'; - import { Button, InputNumber, InputSelect, InputText } from '$lib/elements/forms'; + import { Button, InputSelect, InputText } from '$lib/elements/forms'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; @@ -15,13 +15,14 @@ let address2: string; let city: string; let state: string; - let zip: number; + let zip: string; let options = [ { value: 'US', label: 'United States' } ]; + let error: string = null; onMount(async () => { const countryList = await sdk.forProject.locale.listCountries(); @@ -41,7 +42,7 @@ address2, city, state, - zip?.toString() + zip ); await invalidate(Dependencies.ADDRESS); show = false; @@ -50,19 +51,16 @@ message: `Address has been added` }); trackEvent(Submit.BillingAddressCreated); - } catch (error) { - addNotification({ - type: 'error', - message: error.message - }); - trackError(error, Submit.BillingAddressCreated); + } catch (e) { + error = e.message; + trackError(e, Submit.BillingAddressCreated); } } $: isButtonDisabled = !country || !address || !city || !state || !zip; - + - {:else} - -

Create a new project

-
+ {/if} @@ -122,7 +122,7 @@ {:else} {/if}