Skip to content

Commit

Permalink
[Glitch] Do not change follow counters when already following
Browse files Browse the repository at this point in the history
Port 029c99b to glitch-soc

Signed-off-by: Claire <[email protected]>
  • Loading branch information
oneiros authored and ClearlyClaire committed Oct 26, 2024
1 parent 28287eb commit 50a40d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascript/flavours/glitch/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 50a40d1

Please sign in to comment.