fix: use lenght instead of total for condition checks

This commit is contained in:
Arman
2023-12-09 11:00:08 +01:00
parent 8c27566c0c
commit 2d1981d6fe
+2 -2
View File
@@ -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,