Filter communications in the frontend

Since we will know about communications we just moved into another state
in frontend land.
This commit is contained in:
Eli Ribble 2026-05-11 22:14:23 +00:00
parent 3a3cd78cac
commit 633abd19a9
No known key found for this signature in database
2 changed files with 12 additions and 1 deletions

View file

@ -14,7 +14,7 @@
</template>
<template #left>
<CommunicationColumnList
:all="storeCommunication.all"
:all="visibleCommunications"
@deselect="handleDeselect"
:loading="storeCommunication.loading"
:selectedID="selectedId"
@ -192,6 +192,14 @@ const selectedReport = computedAsync(
return await storePublicReport.byURI(selectedCommunication.value.source);
},
);
const visibleCommunications = computed((): Communication[] => {
if (!storeCommunication.all) {
return [];
}
return storeCommunication.all.filter((c: Communication) => {
return c.status == "new" || c.status == "opened";
});
});
const handleDeselect = (id: string) => {
selectedId.value = undefined;
};