From 1edd14cf30dc771e8fd86d5f5d7fd67ab58f8fae Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 17 Apr 2026 11:04:58 +0200 Subject: [PATCH] notifitem: handle notification closed by app to prevent dismiss-on-destroyed error --- modules/NotifItem.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/NotifItem.qml b/modules/NotifItem.qml index 1f5199f..d3e96b9 100644 --- a/modules/NotifItem.qml +++ b/modules/NotifItem.qml @@ -42,6 +42,14 @@ QtObject { return d > 0 ? d + "d" : h + "h"; } + // App closed the notification from its side — remove from our list while the object is still alive + readonly property Connections _notifConn: Connections { + target: root.notification + function onClosed() { + M.NotifService.dismiss(root.id); + } + } + function beginDismiss() { if (state === "visible") state = "dismissing";