From f51e99dc803ced7399730fd2560c3db00a979a57 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Mon, 5 Jan 2026 21:55:07 -0500 Subject: [PATCH] Remove modified --- web/public/static/langs/en.json | 1 - web/src/app/SubscriptionManager.js | 19 ++----------------- web/src/components/Notifications.jsx | 7 ++----- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/web/public/static/langs/en.json b/web/public/static/langs/en.json index 0895b2eb..b0d3c545 100644 --- a/web/public/static/langs/en.json +++ b/web/public/static/langs/en.json @@ -70,7 +70,6 @@ "notifications_delete": "Delete", "notifications_copied_to_clipboard": "Copied to clipboard", "notifications_tags": "Tags", - "notifications_modified": "modified {{date}}", "notifications_priority_x": "Priority {{priority}}", "notifications_new_indicator": "New notification", "notifications_attachment_image": "Attachment image", diff --git a/web/src/app/SubscriptionManager.js b/web/src/app/SubscriptionManager.js index 086fc048..ccce5ccc 100644 --- a/web/src/app/SubscriptionManager.js +++ b/web/src/app/SubscriptionManager.js @@ -175,31 +175,16 @@ class SubscriptionManager { } // Collapse notification updates based on sids, keeping only the latest version - // Also tracks the original time (earliest) for each sequence groupNotificationsBySID(notifications) { const latestBySid = {}; - const originalTimeBySid = {}; - notifications.forEach((notification) => { const key = `${notification.subscriptionId}:${notification.sid}`; - - // Track the latest notification for each sid (first one since sorted DESC) + // Keep only the first (latest by time) notification for each sid if (!(key in latestBySid)) { latestBySid[key] = notification; } - - // Track the original (earliest) time for each sid - const currentOriginal = originalTimeBySid[key]; - if (currentOriginal === undefined || notification.time < currentOriginal) { - originalTimeBySid[key] = notification.time; - } }); - - // Return latest notifications with originalTime set - return Object.entries(latestBySid).map(([key, notification]) => ({ - ...notification, - originalTime: originalTimeBySid[key], - })); + return Object.values(latestBySid); } /** Adds notification, or returns false if it already exists */ diff --git a/web/src/components/Notifications.jsx b/web/src/components/Notifications.jsx index 343a284a..94185b7c 100644 --- a/web/src/components/Notifications.jsx +++ b/web/src/components/Notifications.jsx @@ -236,9 +236,7 @@ const NotificationItem = (props) => { const { t, i18n } = useTranslation(); const { notification } = props; const { attachment } = notification; - const isModified = notification.originalTime && notification.originalTime !== notification.time; - const originalDate = formatShortDateTime(notification.originalTime || notification.time, i18n.language); - const modifiedDate = isModified ? formatShortDateTime(notification.time, i18n.language) : null; + const date = formatShortDateTime(notification.time, i18n.language); const otherTags = unmatchedTags(notification.tags); const tags = otherTags.length > 0 ? otherTags.join(", ") : null; const handleDelete = async () => { @@ -289,8 +287,7 @@ const NotificationItem = (props) => { )} - {originalDate} - {modifiedDate && ` (${t("notifications_modified", { date: modifiedDate })})`} + {date} {[1, 2, 4, 5].includes(notification.priority) && (