From 9880618ca16ad232859f9be04345ab572d99a310 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Mon, 22 Jul 2024 00:25:03 +0200 Subject: [PATCH 1/2] 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) => { From 54d1de32a73e4d03b37279b01590de74a386d2a7 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 5 Nov 2024 22:50:54 +0100 Subject: [PATCH 2/2] refactor: remove magic number in getNotificationsOverheadDrivers getter Signed-off-by: Stefan Dej --- src/store/gui/notifications/getters.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/gui/notifications/getters.ts b/src/store/gui/notifications/getters.ts index 5c1f5d4d8..ccde3ea86 100644 --- a/src/store/gui/notifications/getters.ts +++ b/src/store/gui/notifications/getters.ts @@ -439,13 +439,13 @@ export const getters: GetterTree = { // get all dismissed tmcwarnings and convert it to a string[] const tmcwarningsDismisses = getters['getDismissByCategory']('tmcwarning').map( (dismiss: GuiNotificationStateDismissEntry) => { - return dismiss.id + return `tmcwarning/${dismiss.id}` } ) // return filtered tmcwarnings return notifications.filter((entry) => { - return !tmcwarningsDismisses.includes(entry.id.substring(11)) + return !tmcwarningsDismisses.includes(entry.id) }) },