Skip to content

Commit

Permalink
Fix Alerter always showing 'No recent alerts.'
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Jul 28, 2023
1 parent cfceda8 commit 0ab4307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/widgets/Alerter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ let currentAlertInterval: NodeJS.Timer | undefined = undefined
onMounted(() => {
currentAlertInterval = setInterval(() => {
const dateNow = new Date(timeNow.value)
const secsSinceLastAlert = differenceInSeconds(dateNow, alertStore.alerts.first()?.time_created || dateNow)
const secsSinceLastAlert = differenceInSeconds(dateNow, alertStore.alerts.last()?.time_created || dateNow)
if (secsSinceLastAlert > alertPersistencyInterval) {
currentAlert.value = new Alert(AlertLevel.Info, 'No recent alerts.')
return
}
currentAlert.value = alertStore.alerts.first()!
currentAlert.value = alertStore.alerts.last()!
}, 1000)
})
Expand Down

0 comments on commit 0ab4307

Please sign in to comment.