notifitem: handle notification closed by app to prevent dismiss-on-destroyed error

This commit is contained in:
Damocles 2026-04-17 11:04:58 +02:00
parent 2e3f3a9f3c
commit 1edd14cf30

View file

@ -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";