diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index fc74380e..e853f4f0 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -107,7 +107,7 @@ Variants { // Connect to animation signal from service - UPDATED TO USE ID Component.onCompleted: { - NotificationService.animateAndRemove.connect(function (notificationId, index) { + NotificationService.animateAndRemove.connect(function (notificationId) { // Find the delegate by notification ID var delegate = null if (notificationStack && notificationStack.children && notificationStack.children.length > 0) { @@ -120,11 +120,6 @@ Variants { } } - // Fallback to index if ID lookup failed - if (!delegate && notificationStack && notificationStack.children && notificationStack.children[index]) { - delegate = notificationStack.children[index] - } - if (delegate && delegate.animateOut) { delegate.animateOut() } else { diff --git a/Services/NotificationService.qml b/Services/NotificationService.qml index eb0fb3ba..aad1ae75 100644 --- a/Services/NotificationService.qml +++ b/Services/NotificationService.qml @@ -187,7 +187,9 @@ Singleton { running: activeList.count > 0 onTriggered: { const now = Date.now() - const durations = [3000, 8000, 15000] // low, normal, critical + const durations = [Settings.data.notifications?.lowUrgencyDuration * 1000 || 3000, + Settings.data.notifications?.normalUrgencyDuration * 1000 || 8000, + Settings.data.notifications?.criticalUrgencyDuration * 1000 || 15000] for (var i = activeList.count - 1; i >= 0; i--) { const notif = activeList.get(i) @@ -203,7 +205,7 @@ Singleton { updateModel(activeList, notif.id, "progress", progress) if (elapsed >= expire) { - animateAndRemove(notif.id, i) + animateAndRemove(notif.id) delete progressTimers[notif.id] break } @@ -397,7 +399,7 @@ Singleton { } // Signals & connections - signal animateAndRemove(string notificationId, int index) + signal animateAndRemove(string notificationId) Connections { target: Settings.data.notifications