fixed filtered on status_filter in incident tab in home.vue, after refactoring and using filtered_incidents...

This commit is contained in:
2026-04-01 15:15:50 -04:00
parent ed319a6423
commit 9a64e87282

View File

@@ -28,6 +28,11 @@ const active_tab = computed({
// const severity_filter = ref<number | null>(null) // NOTE: Null here means show all severities.
const status_filter = ref<string | null>(null)
const displayed_incidents = computed(() => {
if (status_filter.value === null) return filtered_incidents.value
return filtered_incidents.value.filter(i => i.status === status_filter.value)
})
const fetch_all = async (before?: number) => {
const was_live = store.is_live
const alarm_url = before ? `${ALARMS_ENDPOINT}?before=${before}` : `${ALARMS_ENDPOINT}`
@@ -141,7 +146,7 @@ onMounted(async () => {
</div>
</div>
<div class="alarm_scroll">
<IncidentCard :data="filtered_incidents" />
<IncidentCard :data="displayed_incidents" />
</div>
</div>
<div v-if="active_tab === 'sites'">