From 09bdcb6913cb676913881e6bf989d93174cf78e6 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 28 Jul 2026 15:00:22 +0200 Subject: [PATCH] fix(notifications): wire toast close broadcasting once in add_notification --- .../addons/notification_center/notification_banner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bec_widgets/widgets/containers/main_window/addons/notification_center/notification_banner.py b/bec_widgets/widgets/containers/main_window/addons/notification_center/notification_banner.py index 263ea2db..3e2e6a1a 100644 --- a/bec_widgets/widgets/containers/main_window/addons/notification_center/notification_banner.py +++ b/bec_widgets/widgets/containers/main_window/addons/notification_center/notification_banner.py @@ -1139,8 +1139,10 @@ class BECNotificationBroker(BECConnector, QObject): "traceback": detailed_trace, "lifetime_ms": lifetime, } + # close broadcasting and expiry pruning are wired inside add_notification, + # covering live and replayed toasts alike — no per-toast hookup needed here for centre in centres: - toast = centre.add_notification( + centre.add_notification( title=title, body=body_text, traceback=detailed_trace, @@ -1148,9 +1150,6 @@ class BECNotificationBroker(BECConnector, QObject): lifetime_ms=lifetime, notification_id=notification_id, ) - # broadcast close events (expiry pruning is wired in add_notification so - # replayed toasts are covered as well) - toast.closed.connect(lambda nid=notification_id: self.notification_closed.emit(nid)) @SafeSlot(dict, dict) def on_scan_status(self, msg: dict, meta: dict) -> None: