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) {