From daee063c8e713468806c25d27e7c6fcff340a41f Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 7 Nov 2024 01:04:01 +0000 Subject: fix: notification example correction: no, it does not make sense to make it a singleton --- .../js/notifications/notifications/NotificationPopups.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'examples/js') diff --git a/examples/js/notifications/notifications/NotificationPopups.tsx b/examples/js/notifications/notifications/NotificationPopups.tsx index 399e3e0..a8088c9 100644 --- a/examples/js/notifications/notifications/NotificationPopups.tsx +++ b/examples/js/notifications/notifications/NotificationPopups.tsx @@ -11,16 +11,6 @@ const TIMEOUT_DELAY = 5000 // with a Map type in order to track notification widgets // by their id, while making it conviniently bindable as an array class NotifiationMap implements Subscribable { - // it makes sense to share a single instance across all monitors - static get_default() { - if (!this.instance) - this.instance = new NotifiationMap() - - return this.instance - } - - private static instance: NotifiationMap - // the underlying map to keep track of id widget pairs private map: Map = new Map() @@ -101,7 +91,7 @@ class NotifiationMap implements Subscribable { export default function NotificationPopups(gdkmonitor: Gdk.Monitor) { const { TOP, RIGHT } = Astal.WindowAnchor - const notifs = NotifiationMap.get_default() + const notifs = new NotifiationMap() return