From 3e99a96fcff42b241c4c562d469ec9458ecc0674 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 11 Jun 2024 17:08:33 +0200 Subject: [PATCH] fix: copy and disabled state --- src/routes/console/apply-credit/+page.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/console/apply-credit/+page.svelte b/src/routes/console/apply-credit/+page.svelte index 46b949bd5..3ac88c5ca 100644 --- a/src/routes/console/apply-credit/+page.svelte +++ b/src/routes/console/apply-credit/+page.svelte @@ -163,7 +163,9 @@ (team) => team.$id === selectedOrgId ) as Organization; - $: isButtonDisabled = checkButtonDisabled(selectedOrgId, name, paymentMethodId); + $: isButtonDisabled = + checkButtonDisabled(selectedOrgId, name, paymentMethodId) || + couponData?.status !== 'active'; $: campaign = campaigns.get(data?.couponData?.campaign ?? data?.campaign); function checkButtonDisabled(id: string | null, name: string | null, method: string | null) { @@ -222,7 +224,7 @@ noMargin disabled={!!couponData?.credits} on:click={() => (showCreditModal = true)}> - Add credits + Apply coupon code {/if}