From 7a2064b7b492b079652e2a04b3ad549e1a73f5e9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 25 Feb 2025 06:03:36 +0000 Subject: [PATCH] Fix: show current plan in the select plan list --- src/lib/components/billing/selectPlan.svelte | 50 ++++++++++++++++++- .../billing/planSummary.svelte | 2 +- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/lib/components/billing/selectPlan.svelte b/src/lib/components/billing/selectPlan.svelte index 8aae2f0ac..b584d9659 100644 --- a/src/lib/components/billing/selectPlan.svelte +++ b/src/lib/components/billing/selectPlan.svelte @@ -2,7 +2,7 @@ import { BillingPlan } from '$lib/constants'; import { formatCurrency } from '$lib/helpers/numbers'; import { plansInfo } from '$lib/stores/billing'; - import { organization } from '$lib/stores/organization'; + import { currentPlan, organization } from '$lib/stores/organization'; import { LabelCard } from '..'; export let billingPlan: string; @@ -10,16 +10,62 @@ export let isNewOrg = false; let classes: string = ''; export { classes as class }; + + let isCurrentPlanShown: boolean = false; + + function currentPlanExists() { + for (let plan in $plansInfo.values()) { + if (plan.$id === $currentPlan.$id) { + return true; + } + } + return false; + } + + $: isCurrentPlanShown = currentPlanExists(); {#if billingPlan}