From ff85540904bd049a1e5880b1eec5e304600cb5b3 Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Tue, 22 Oct 2024 14:49:10 +0200 Subject: [PATCH] [Glitch] Do not change follow counters when already following Port 029c99bd7b5bca19b11d63a09c3e71b86306dad4 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/reducers/accounts.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/reducers/accounts.ts b/app/javascript/flavours/glitch/reducers/accounts.ts index c9d7b5fe12..cbdfbcd832 100644 --- a/app/javascript/flavours/glitch/reducers/accounts.ts +++ b/app/javascript/flavours/glitch/reducers/accounts.ts @@ -57,7 +57,10 @@ export const accountsReducer: Reducer = ( 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),