diff --git a/modules/NotifService.qml b/modules/NotifService.qml index 0591eae..77b829e 100644 --- a/modules/NotifService.qml +++ b/modules/NotifService.qml @@ -90,7 +90,13 @@ QtObject { }); root._byId[item.id] = item; - root.list = [item, ...root.list]; + root.list = [item, ...root.list].sort((a, b) => { + const aU = a.urgency === NotificationUrgency.Critical ? 1 : 0; + const bU = b.urgency === NotificationUrgency.Critical ? 1 : 0; + if (aU !== bU) + return bU - aU; + return b.time - a.time; + }); // Trim excess popups const max = M.Modules.notifications.maxPopups || 4; @@ -174,6 +180,13 @@ QtObject { root._byId[item.id] = item; root.list.push(item); } + root.list.sort((a, b) => { + const aU = a.urgency === NotificationUrgency.Critical ? 1 : 0; + const bU = b.urgency === NotificationUrgency.Critical ? 1 : 0; + if (aU !== bU) + return bU - aU; + return b.time - a.time; + }); root._changed(); } catch (e) {} }