From 4578aad0bcb76b138c1860062c770c9d4a63ad6e Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 7 Sep 2025 14:57:09 +0200 Subject: [PATCH] NotificationHistory: properly hook up the unread counter --- Modules/Bar/Widgets/NotificationHistory.qml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 9897d05..81ac749 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -33,7 +33,7 @@ NIconButton { readonly property bool userDoNotDisturb: (widgetSettings.doNotDisturb !== undefined) ? widgetSettings.doNotDisturb : BarWidgetRegistry.widgetMetadata["NotificationHistory"].doNotDisturb function lastSeenTs() { - return widgetSettings.lastSeenTs || 0 + return Settings.data.notifications?.lastSeenTs || 0 } function computeUnreadCount() { @@ -59,23 +59,9 @@ NIconButton { colorBorderHover: Color.transparent onClicked: { - // Open first using current geometry as anchor var panel = PanelService.getPanel("notificationHistoryPanel") panel?.toggle(screen, this) - // Update last seen right after to avoid affecting anchor calculation - Qt.callLater(function () { - try { - var section = barSection.replace("Section", "").toLowerCase() - if (section && sectionWidgetIndex >= 0) { - var widgets = Settings.data.bar.widgets[section] - if (widgets && sectionWidgetIndex < widgets.length) { - widgets[sectionWidgetIndex].lastSeenTs = Time.timestamp * 1000 - } - } - } catch (e) { - - } - }) + Settings.data.notifications.lastSeenTs = Time.timestamp * 1000 } onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb