We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c601562 + d4fb158 commit b0553dfCopy full SHA for b0553df
src/lib/components/billing/alerts/realtimePricing.svelte
@@ -16,9 +16,14 @@
16
}
17
18
19
- $: href = $currentPlan?.usagePerProject
20
- ? `${base}/organization-${$organization.$id}/billing`
21
- : `${base}/organization-${$organization.$id}/usage`;
+ // Guard org id: this reactive runs even when the {#if} below is false, so optional
+ // chaining on $currentPlan alone is not enough — $organization can be undefined.
+ $: orgId = $organization?.$id;
22
+ $: href = orgId
23
+ ? $currentPlan?.usagePerProject
24
+ ? `${base}/organization-${orgId}/billing`
25
+ : `${base}/organization-${orgId}/usage`
26
+ : '';
27
</script>
28
29
{#if $organization?.$id && !dismissed}
0 commit comments