remove unecessary notification in frontend
This commit is contained in:
parent
c721f25104
commit
ae275aeabb
|
@ -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<EventNotification[]>(() => {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue