about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-09-28 21:44:29 +0200
committerThibaut Girka <thib@sitedethib.com>2020-10-21 19:24:32 +0200
commitc3d82027cf8805ba91e1447960c5e933ecc4b2a7 (patch)
treefa1d40eab644d6fa242a6a0535554e4b360dcdc6 /app/javascript/flavours/glitch
parentec49aa81753ac71fa26b2ee86448fa5b481d49e4 (diff)
[Glitch] Fix bell button causing a brief “Cancel follow request” on locked accounts
Port 82951920f7321fefbdf0628cbb70f2f490f7b716 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch')
-rw-r--r--app/javascript/flavours/glitch/reducers/relationships.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/relationships.js b/app/javascript/flavours/glitch/reducers/relationships.js
index 33eb5b425..49dd77ef5 100644
--- a/app/javascript/flavours/glitch/reducers/relationships.js
+++ b/app/javascript/flavours/glitch/reducers/relationships.js
@@ -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: