diff --git a/frontend/src/ts/commandline/commands.ts b/frontend/src/ts/commandline/commands.ts index 43bcf1595..d5270dc6c 100644 --- a/frontend/src/ts/commandline/commands.ts +++ b/frontend/src/ts/commandline/commands.ts @@ -380,6 +380,14 @@ export const commands: MonkeyTypes.CommandsSubgroup = { return JSON.stringify(Config); }, }, + { + id: "clearNotifications", + display: "Clear all notifications", + icon: "fa-trash-alt", + exec: async (): Promise => { + Notifications.clearAllNotifications(); + }, + }, { id: "clearSwCache", display: "Clear SW cache", diff --git a/frontend/src/ts/elements/notifications.ts b/frontend/src/ts/elements/notifications.ts index f23f0905f..1d8e32a50 100644 --- a/frontend/src/ts/elements/notifications.ts +++ b/frontend/src/ts/elements/notifications.ts @@ -277,6 +277,10 @@ export function addBanner( return banner.id; } +export function clearAllNotifications(): void { + $("#notificationCenter .notif").remove(); +} + const debouncedMarginUpdate = debounce(100, updateMargin); $(window).on("resize", () => {