Added filters for notifications and system tray items. (#234)

* Added filters for notifications and systray. closes #233

* Add links to documentation.
This commit is contained in:
Jas Singh
2024-09-08 02:01:13 -07:00
committed by GitHub
parent bd573ec4e7
commit 4f91bb8b8f
22 changed files with 630 additions and 174 deletions

View File

@@ -0,0 +1,15 @@
import { Notification } from "types/service/notifications";
export const filterNotifications = (notifications: Notification[], filter: string[]): Notification[] => {
const notifFilter = new Set(
filter.map((name: string) => name.toLowerCase().replace(/\s+/g, '_'))
);
const filteredNotifications = notifications.filter((notif: Notification) => {
const normalizedAppName = notif.app_name.toLowerCase().replace(/\s+/g, '_');
return !notifFilter.has(normalizedAppName);
});
return filteredNotifications;
}