From 0f9bfb342c49fb90f2fa0d467bfe20a5d36a83d6 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 18 Jun 2024 11:07:01 +0200 Subject: [PATCH] Fix duplicate accounts in a group --- app/javascript/mastodon/reducers/notifications_groups.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/reducers/notifications_groups.ts b/app/javascript/mastodon/reducers/notifications_groups.ts index aa869bf9b5..c332525421 100644 --- a/app/javascript/mastodon/reducers/notifications_groups.ts +++ b/app/javascript/mastodon/reducers/notifications_groups.ts @@ -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) >