Fix notifications "mark all" not working on Desktop

## Issue
6343
This commit is contained in:
infinite-persistence 2021-07-06 10:53:30 +08:00 committed by infinite-persistence
parent 75a78cb65d
commit d1ee904dab

View file

@ -124,7 +124,7 @@ export function doReadNotifications(notificationsIds: Array<number>) {
} else {
// A null or invalid argument will wipe all unread notifications.
const getUnreadIds = (list) => list.filter((n) => !n.is_read).map((n) => n.id);
ids = [...new Set([...getUnreadIds(notifications), ...getUnreadIds(notificationsFiltered)])];
ids = Array.from(new Set([...getUnreadIds(notifications), ...getUnreadIds(notificationsFiltered)]));
}
dispatch({ type: ACTIONS.NOTIFICATION_READ_STARTED });
@ -167,7 +167,7 @@ export function doSeeAllNotifications() {
}
const getUnseenIds = (list) => list.filter((n) => !n.is_seen).map((n) => n.id);
const unseenIds = [...new Set([...getUnseenIds(notifications), ...getUnseenIds(notificationsFiltered)])];
const unseenIds = Array.from(new Set([...getUnseenIds(notifications), ...getUnseenIds(notificationsFiltered)]));
dispatch(doSeeNotifications(unseenIds));
};