Skip to content

Commit bc0baac

Browse files
committed
fix: update isNewOrg logic on apply-credit page
The logic was for an existing org, but the variable name was isNewOrg. This commit updates the logic to match the variable name.
1 parent ecaacff commit bc0baac

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/routes/(console)/apply-credit/+page.svelte

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,12 @@
246246
billingPlan = getBillingPlan();
247247
}
248248
249-
$: isNewOrg = selectedOrgId && selectedOrgId !== newOrgId;
249+
$: isNewOrg = !(selectedOrgId && selectedOrgId !== newOrgId);
250250
251-
$: {
252-
if (isNewOrg) {
253-
(async () => {
254-
currentPlan = await sdk.forConsole.billing.getOrganizationPlan(selectedOrgId);
255-
})();
256-
}
251+
$: if (!isNewOrg) {
252+
(async () => {
253+
currentPlan = await sdk.forConsole.billing.getOrganizationPlan(selectedOrgId);
254+
})();
257255
}
258256
259257
// after adding a payment method, fetch the payment methods again so the input can be updated
@@ -371,7 +369,7 @@
371369
{collaborators}
372370
bind:couponData
373371
bind:billingBudget
374-
organizationId={isNewOrg ? selectedOrgId : null}>
372+
organizationId={!isNewOrg ? selectedOrgId : null}>
375373
{#if campaign?.template === 'review' && (campaign?.cta || campaign?.claimed || campaign?.unclaimed)}
376374
<div class="u-margin-block-end-24">
377375
<p class="body-text-1 u-bold">{campaign?.cta}</p>

0 commit comments

Comments
 (0)