Merge pull request #2961 from appwrite/chore-add-org-guard

fix(console): guard organization access in realtimePricing to prevent runtime crash
This commit is contained in:
Harsh Mahajan
2026-04-07 19:12:48 +05:30
committed by GitHub
@@ -16,9 +16,14 @@
}
}
$: href = $currentPlan?.usagePerProject
? `${base}/organization-${$organization.$id}/billing`
: `${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;
$: href = orgId
? $currentPlan?.usagePerProject
? `${base}/organization-${orgId}/billing`
: `${base}/organization-${orgId}/usage`
: '';
</script>
{#if $organization?.$id && !dismissed}