diff --git a/src/lib/components/billing/alerts/paymentAuthRequired.svelte b/src/lib/components/billing/alerts/paymentAuthRequired.svelte
index 257b86d16..f53b5ae1d 100644
--- a/src/lib/components/billing/alerts/paymentAuthRequired.svelte
+++ b/src/lib/components/billing/alerts/paymentAuthRequired.svelte
@@ -21,7 +21,7 @@
diff --git a/src/lib/stores/headerAlert.ts b/src/lib/stores/headerAlert.ts
index 42a7d3261..cde668b3b 100644
--- a/src/lib/stores/headerAlert.ts
+++ b/src/lib/stores/headerAlert.ts
@@ -46,7 +46,7 @@ function createHeaderAlertStore() {
});
return n;
});
- return component;
+ return component as HeaderAlert;
}
};
}
diff --git a/src/routes/console/+layout.svelte b/src/routes/console/+layout.svelte
index 16e738b69..04a3eba86 100644
--- a/src/routes/console/+layout.svelte
+++ b/src/routes/console/+layout.svelte
@@ -10,7 +10,7 @@
import { log } from '$lib/stores/logs';
import { newOrgModal, organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
- import { onMount } from 'svelte';
+ import { afterUpdate, onMount } from 'svelte';
import { loading, requestedMigration } from '../store';
import Create from './createOrganization.svelte';
import {
@@ -242,7 +242,7 @@
}
]);
let isOpen = false;
-
+ let selectedHeaderAlert = headerAlert.get();
onMount(async () => {
loading.set(false);
if (isCloud && !$page.url.pathname.includes('/console/onboarding')) {
@@ -314,6 +314,7 @@
});
}
checkPaymentAuthorizationRequired();
+ selectedHeaderAlert = headerAlert.get();
}
});
@@ -448,6 +449,7 @@
$actionRequiredInvoices = await sdk.forConsole.billing.listInvoices($organization.$id, [
Query.equal('status', 'requires_authentication')
]);
+ console.log($actionRequiredInvoices);
if ($actionRequiredInvoices && $actionRequiredInvoices.total) {
headerAlert.add({
id: 'paymentAuthRequired',
@@ -455,6 +457,7 @@
show: true,
importance: 8
});
+ console.log($headerAlert);
}
}
@@ -469,7 +472,11 @@
$registerSearchers(orgSearcher, projectsSearcher);
- $: selectedHeaderAlert = headerAlert.get();
+ afterUpdate(() => {
+ selectedHeaderAlert = headerAlert.get();
+ });
+
+ $: console.log(selectedHeaderAlert);