From a5160e0c745cdda404c02ab5be26fda418c168cc Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 8 Jun 2025 10:23:19 +0530 Subject: [PATCH] fix: show correct plan name tag/badge. --- src/lib/components/breadcrumbs.svelte | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index 0951839d8..01f8c72a2 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -12,7 +12,7 @@ import { isCloud } from '$lib/system'; import { goto } from '$app/navigation'; import { base } from '$app/paths'; - import { newOrgModal } from '$lib/stores/organization'; + import { currentPlan, newOrgModal } from '$lib/stores/organization'; import { Click, trackEvent } from '$lib/actions/analytics'; import { page } from '$app/stores'; @@ -182,6 +182,14 @@ projectsBottomSheetOpen = false; } } + + $: correctPlanName = + // the plan names are hardcoded in some cases and are not available locally, + // so we rely on the plan's source of truth - `$currentPlan` + $currentPlan && + $currentPlan?.name.toLocaleLowerCase() !== selectedOrg?.tierName.toLocaleLowerCase() + ? $currentPlan.name + : selectedOrg?.tierName; // fallback @@ -195,9 +203,9 @@ aria-label="Open organizations tab"> {selectedOrg?.name ?? 'Organization'} {#if selectedOrg?.tierName}{#if correctPlanName}{/if} + content={correctPlanName} />{/if} {:else} @@ -211,7 +219,7 @@ {selectedOrg?.name ?? 'Organization'} + > {/if}