From aa9ae2a3b442da64237a35b38eaafe77c7afe67b Mon Sep 17 00:00:00 2001 From: Darshan Date: Sat, 8 Feb 2025 14:27:02 +0530 Subject: [PATCH] fix: misleading alerts on invoice failed x service limit reached. --- .../billing/alerts/paymentFailed.svelte | 26 +++++++++++++++++++ src/lib/layout/containerHeader.svelte | 4 +-- src/lib/stores/billing.ts | 7 ++--- .../(console)/project-[project]/+layout.ts | 11 ++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 src/lib/components/billing/alerts/paymentFailed.svelte diff --git a/src/lib/components/billing/alerts/paymentFailed.svelte b/src/lib/components/billing/alerts/paymentFailed.svelte new file mode 100644 index 000000000..51721c892 --- /dev/null +++ b/src/lib/components/billing/alerts/paymentFailed.svelte @@ -0,0 +1,26 @@ + + + +{#if $failedInvoice && $failedInvoice.teamId === $organization.$id && isOnProjects} + + To avoid service disruptions in your projects, please verify your payment details and try + again. + + + + +{/if} diff --git a/src/lib/layout/containerHeader.svelte b/src/lib/layout/containerHeader.svelte index ab59f4780..6c3a86c16 100644 --- a/src/lib/layout/containerHeader.svelte +++ b/src/lib/layout/containerHeader.svelte @@ -69,7 +69,7 @@ ? checkForUsageFees($organization?.billingPlan, serviceId) : false; $: isLimited = limit !== 0 && limit < Infinity; - $: overflowingServices = limitedServices.filter((service) => service.value >= 0); + $: overflowingServices = limitedServices.filter((service) => service.value > 0); $: isButtonDisabled = buttonDisabled || ($readOnly && !GRACE_PERIOD_OVERRIDE) || @@ -102,7 +102,7 @@ >. - {:else} + {:else if services.length} You've reached the {services} limit for the {tier} plan.