Fix duplicate accounts in a group

Renaud Chaput 2024-06-18 11:07:01 +02:00 committed by Claire
parent e92c2b9a96
commit 4e5768ed5e
1 changed files with 5 additions and 1 deletions

View File

@ -133,7 +133,11 @@ export const notificationsGroupsReducer =
if (existingGroupIndex > -1) {
const existingGroup = state.groups[existingGroupIndex];
if (existingGroup && existingGroup.type !== 'gap') {
if (
existingGroup &&
existingGroup.type !== 'gap' &&
!existingGroup.sampleAccountsIds.includes(notification.account.id) // This can happen for example if you like, then unlike, then like again the same post
) {
// Update the existing group
if (
existingGroup.sampleAccountsIds.unshift(notification.account.id) >