diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 353f1a933..31200bf57 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -65,7 +65,7 @@ export const plansInfo = derived(page, ($page) => $page.data.plansInfo as PlansM export const daysLeftInTrial = writable(0); export const readOnly = writable(false); -export const showBudgetAlert = writable(false); +export const showBudgetAlert = derived(page, ($page) => ($page.data.organization?.billingLimits.budgetLimit ?? 0) >= 100); export function getRoleLabel(role: string) { return roles.find((r) => r.value === role)?.label ?? role; @@ -279,7 +279,6 @@ export async function checkForUsageLimit(org: Organization) { return; } - showBudgetAlert.set(true); headerAlert.add({ id: 'budgetLimit', component: BudgetLimitAlert, diff --git a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte index 55c19c50e..5fdc358e2 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte @@ -27,7 +27,6 @@ $organization.budgetAlerts ); await invalidate(Dependencies.ORGANIZATION); - showBudgetAlert.set(false); addNotification({ type: 'success', isHtml: true,