mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user