Skip to content

Commit

Permalink
fix(notifications): fix dismiss function for tmc warnings (#1956)
Browse files Browse the repository at this point in the history
* fix(notifications): fix dismiss function for tmc warnings

Signed-off-by: Stefan Dej <[email protected]>

* refactor: remove magic number in getNotificationsOverheadDrivers getter

Signed-off-by: Stefan Dej <[email protected]>

---------

Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou authored Nov 7, 2024
1 parent ae7f8f1 commit a81672f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/store/gui/notifications/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,17 @@ export const getters: GetterTree<GuiNotificationState, any> = {
}
})

return notifications
// get all dismissed tmcwarnings and convert it to a string[]
const tmcwarningsDismisses = getters['getDismissByCategory']('tmcwarning').map(
(dismiss: GuiNotificationStateDismissEntry) => {
return `tmcwarning/${dismiss.id}`
}
)

// return filtered tmcwarnings
return notifications.filter((entry) => {
return !tmcwarningsDismisses.includes(entry.id)
})
},

getDismiss: (state, getters, rootState) => {
Expand Down

0 comments on commit a81672f

Please sign in to comment.