From ae275aeabb0a05d600618d29dbf0373ffa8be0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Mon, 1 May 2023 22:46:16 +0200 Subject: [PATCH] remove unecessary notification in frontend --- src/pages/EventRequests.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pages/EventRequests.vue b/src/pages/EventRequests.vue index a0f7a17..cfc41d2 100644 --- a/src/pages/EventRequests.vue +++ b/src/pages/EventRequests.vue @@ -59,6 +59,7 @@ import { computed, defineComponent, ref, onBeforeMount, watch } from 'vue'; import { QTableProps } from 'quasar'; import { Job } from '../store/models'; import { useEventStore } from '../store'; +import { EventNotification, InvitationData, InvitationResponseData } from '../events'; export default defineComponent({ name: 'PageEventRequests', @@ -92,6 +93,9 @@ export default defineComponent({ ? store.invitations : store.invitations.filter((i) => i.inviter_id !== mainStore.currentUser.userid) ); + const all_notifications = computed(() => { + return mainStore.notifications.filter((n) => n.plugin === 'events') as EventNotification[]; + }); const showSent = ref(false); async function fillRows(data: FG.Invitation[]) { @@ -247,6 +251,12 @@ export default defineComponent({ filter: () => [], getCellValue: () => [], }); + const notification = all_notifications.value.find( + (n) => n.data.invitation === row.id + ); + if (notification !== undefined) { + void mainStore.removeNotification(notification.id); + } }, }; const accept = { @@ -260,6 +270,12 @@ export default defineComponent({ filter: () => [], getCellValue: () => [], }); + const notification = all_notifications.value.find( + (n) => n.data.invitation === row.id + ); + if (notification !== undefined) { + void mainStore.removeNotification(notification.id); + } }, }; if (sender) {