[Glitch] Do not change follow counters when already following

Port 029c99bd7b5bca19b11d63a09c3e71b86306dad4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
David Roetzel 2024-10-22 14:49:10 +02:00 committed by Claire
parent c2862049a2
commit ff85540904
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,10 @@ export const accountsReducer: Reducer<typeof initialState> = (
return state.setIn([action.payload.id, 'hidden'], false);
else if (importAccounts.match(action))
return normalizeAccounts(state, action.payload.accounts);
else if (followAccountSuccess.match(action)) {
else if (
followAccountSuccess.match(action) &&
!action.payload.alreadyFollowing
) {
return state
.update(action.payload.relationship.id, (account) =>
account?.update('followers_count', (n) => n + 1),