fix: copy and disabled state

This commit is contained in:
Arman
2024-06-11 17:08:33 +02:00
parent 038c6b88b3
commit 3e99a96fcf
+4 -2
View File
@@ -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)}>
<span class="icon-plus"></span> <span class="text">Add credits</span>
<span class="icon-plus"></span> <span class="text">Apply coupon code</span>
</Button>
{/if}
</FormList>