From 2d1981d6fe3bf7ae2041d36c9eb9ccbbb74d2379 Mon Sep 17 00:00:00 2001 From: Arman Date: Sat, 9 Dec 2023 11:00:08 +0100 Subject: [PATCH] fix: use lenght instead of total for condition checks --- src/routes/console/+layout.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/+layout.svelte b/src/routes/console/+layout.svelte index 82fb46fc7..c1ebbcfc4 100644 --- a/src/routes/console/+layout.svelte +++ b/src/routes/console/+layout.svelte @@ -284,7 +284,7 @@ async function checkForFreeOrgOverflow() { const orgs = await sdk.forConsole.teams.list([Query.equal('billingPlan', 'tier-0')]); - if (orgs.total > 1) { + if (orgs?.teams?.length > 1) { headerAlert.add({ id: 'freeOrgOverflow', component: TooManyFreOrgs, @@ -452,7 +452,7 @@ $actionRequiredInvoices = await sdk.forConsole.billing.listInvoices($organization.$id, [ Query.equal('status', 'requires_authentication') ]); - if ($actionRequiredInvoices && $actionRequiredInvoices.total) { + if ($actionRequiredInvoices && $actionRequiredInvoices?.invoices?.length > 0) { headerAlert.add({ id: 'paymentAuthRequired', component: PaymentAuthRequired,