From 9880618ca16ad232859f9be04345ab572d99a310 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Mon, 22 Jul 2024 00:25:03 +0200 Subject: [PATCH] fix(notifications): fix dismiss function for tmc warnings Signed-off-by: Stefan Dej --- src/store/gui/notifications/getters.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/store/gui/notifications/getters.ts b/src/store/gui/notifications/getters.ts index 6bd197bed..5c1f5d4d8 100644 --- a/src/store/gui/notifications/getters.ts +++ b/src/store/gui/notifications/getters.ts @@ -436,7 +436,17 @@ export const getters: GetterTree = { } }) - return notifications + // get all dismissed tmcwarnings and convert it to a string[] + const tmcwarningsDismisses = getters['getDismissByCategory']('tmcwarning').map( + (dismiss: GuiNotificationStateDismissEntry) => { + return dismiss.id + } + ) + + // return filtered tmcwarnings + return notifications.filter((entry) => { + return !tmcwarningsDismisses.includes(entry.id.substring(11)) + }) }, getDismiss: (state, getters, rootState) => {