diff --git a/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte b/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte index a0f0ee6591..f369030f0f 100644 --- a/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte +++ b/frontend/src/lib/components/sidebar/CriticalAlertModal.svelte @@ -154,6 +154,9 @@ ) } numUnacknowledgedCriticalAlerts = unacknowledged.length + } catch (e) { + console.error('Error fetching critical alerts', e) + sendUserToast('Error fetching critical alerts', true) } finally { checkingForNewAlerts = false } diff --git a/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte b/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte index 6f7fbb4b17..02244a87f6 100644 --- a/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte +++ b/frontend/src/lib/components/sidebar/CriticalAlertModalInner.svelte @@ -8,6 +8,7 @@ import RefreshButton from '$lib/components/common/button/RefreshButton.svelte' import CriticalAlertTable from './CriticalAlertTable.svelte' import Alert from '$lib/components/common/alert/Alert.svelte' + import { sendUserToast } from '$lib/toast' export let updateHasUnacknowledgedCriticalAlerts export let getCriticalAlerts @@ -52,6 +53,9 @@ totalNumberOfAlerts = res.total_rows filteredAlerts = res.alerts updateHasUnacknowledgedCriticalAlerts() + } catch (e) { + console.error('Error fetching critical alerts', e) + sendUserToast('Error fetching critical alerts', true) } finally { setTimeout(() => { isRefreshing = false diff --git a/frontend/src/lib/storeUtils.ts b/frontend/src/lib/storeUtils.ts index 54176cf5b0..ec95c11a7e 100644 --- a/frontend/src/lib/storeUtils.ts +++ b/frontend/src/lib/storeUtils.ts @@ -1,5 +1,5 @@ import { resourceTypesStore } from './components/resourceTypesStore' -import { workspaceStore, userStore, usersWorkspaceStore, superadmin } from './stores' +import { workspaceStore, userStore, usersWorkspaceStore, superadmin, devopsRole } from './stores' export function switchWorkspace(workspace: string | undefined) { try { @@ -26,4 +26,5 @@ export function clearStores(): void { workspaceStore.set(undefined) usersWorkspaceStore.set(undefined) superadmin.set(undefined) + devopsRole.set(undefined) }