Skip to content

Commit

Permalink
Do not change follow counters when already following (mastodon#32622)
Browse files Browse the repository at this point in the history
  • Loading branch information
oneiros authored Oct 22, 2024
1 parent 18659f8 commit 029c99b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascript/mastodon/reducers/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 029c99b

Please sign in to comment.