Fix notification marker

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-05-11 09:23:58 +02:00
parent 001234dae1
commit 2f57d0a5bd

View file

@ -372,12 +372,12 @@ const markReadNotifications = () =>
if (!isLoggedIn(getState)) return;
const state = getState();
const topNotificationId = state.notifications.items.first()?.id;
let lastReadId = state.notifications.lastRead;
let topNotificationId = state.notifications.items.first()?.id;
const lastReadId = state.notifications.lastRead;
const v = parseVersion(state.instance.version);
if (typeof lastReadId === 'string' && lastReadId?.includes('+')) {
lastReadId = lastReadId.split('+')[0];
if (typeof topNotificationId === 'string' && topNotificationId?.includes('+')) {
topNotificationId = topNotificationId.split('+')[0];
}
if (topNotificationId && (lastReadId === -1 || compareId(topNotificationId, lastReadId) > 0)) {