diff --git a/src/components/widgets/Alerter.vue b/src/components/widgets/Alerter.vue index e639f2b09..f538799c5 100644 --- a/src/components/widgets/Alerter.vue +++ b/src/components/widgets/Alerter.vue @@ -4,9 +4,9 @@ ref="currentAlertBar" class="flex items-center justify-between p-1 overflow-hidden rounded cursor-pointer select-none whitespace-nowrap bg-slate-800/75" > -

{{ currentAlert.message }}

+

{{ currentAlert?.message }}

-

{{ formattedDate(currentAlert.time_created || new Date()) }}

+

{{ formattedDate(currentAlert?.time_created || new Date()) }}

{{ currentAlert.level.toUpperCase() }}

@@ -16,12 +16,12 @@ :class="{ 'opacity-0 invisible': !isShowingExpandedAlerts }" >
-
-

{{ alert.message }}

+
+

{{ alert?.message }}

-

{{ formattedDate(alert.time_created || new Date()) }}

+

{{ formattedDate(alert?.time_created || new Date()) }}

{{ alert.level.toUpperCase() }}

@@ -47,7 +47,7 @@ const alertPersistencyInterval = 10 // in seconds const formattedDate = (datetime: Date): string => format(datetime, 'HH:mm:ss') -const currentAlert = ref(alertStore.alerts[0]) +const currentAlert = ref(alertStore.alerts?.[0] ?? undefined) // eslint-disable-next-line no-undef let currentAlertInterval: NodeJS.Timer | undefined = undefined