Skip to content

Commit

Permalink
fix(notifications): fix dismiss function for tmc warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Jul 21, 2024
1 parent 477c958 commit 9880618
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 dismiss.id
}
)

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

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

0 comments on commit 9880618

Please sign in to comment.