Notification: move lastSeenTs to cache/noctalia/notifications-state.json

This commit is contained in:
lysec
2025-10-21 14:50:27 +02:00
parent 96cb0a5199
commit 4aa32dbdb3
5 changed files with 63 additions and 19 deletions
+1 -5
View File
@@ -31,12 +31,8 @@ NIconButton {
readonly property bool showUnreadBadge: (widgetSettings.showUnreadBadge !== undefined) ? widgetSettings.showUnreadBadge : widgetMetadata.showUnreadBadge
readonly property bool hideWhenZero: (widgetSettings.hideWhenZero !== undefined) ? widgetSettings.hideWhenZero : widgetMetadata.hideWhenZero
function lastSeenTs() {
return Settings.data.notifications?.lastSeenTs || 0
}
function computeUnreadCount() {
var since = lastSeenTs()
var since = NotificationService.lastSeenTs
var count = 0
var model = NotificationService.historyList
for (var i = 0; i < model.count; i++) {
@@ -17,7 +17,7 @@ NPanel {
panelKeyboardFocus: true
onOpened: function () {
Settings.data.notifications.lastSeenTs = Time.timestamp * 1000
NotificationService.updateLastSeenTs()
}
panelContent: Rectangle {