]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix bell button causing a brief “Cancel follow request” on locked accounts
authorThibG <thib@sitedethib.com>
Mon, 28 Sep 2020 19:44:29 +0000 (21:44 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 21 Oct 2020 17:24:32 +0000 (19:24 +0200)
Port 82951920f7321fefbdf0628cbb70f2f490f7b716 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/reducers/relationships.js

index 33eb5b425e7b92e639f90e5f2e1fdfefa2df067d..49dd77ef59825af09632be28d4533d30a81be0bc 100644 (file)
@@ -45,7 +45,7 @@ const initialState = ImmutableMap();
 export default function relationships(state = initialState, action) {
   switch(action.type) {
   case ACCOUNT_FOLLOW_REQUEST:
-    return state.setIn([action.id, action.locked ? 'requested' : 'following'], true);
+    return state.getIn([action.id, 'following']) ? state : state.setIn([action.id, action.locked ? 'requested' : 'following'], true);
   case ACCOUNT_FOLLOW_FAIL:
     return state.setIn([action.id, action.locked ? 'requested' : 'following'], false);
   case ACCOUNT_UNFOLLOW_REQUEST: