about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/relationships.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-09-28 21:44:29 +0200
committerGitHub <noreply@github.com>2020-09-28 21:44:29 +0200
commit82951920f7321fefbdf0628cbb70f2f490f7b716 (patch)
tree0a2b215aca56e2b9c47b52780c358e108161ba30 /app/javascript/mastodon/reducers/relationships.js
parent3ea65472cab256a8e89c89b3452b802473025f6b (diff)
Fix bell button causing a brief “Cancel follow request” on locked accounts (#14896)
Diffstat (limited to 'app/javascript/mastodon/reducers/relationships.js')
-rw-r--r--app/javascript/mastodon/reducers/relationships.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/reducers/relationships.js b/app/javascript/mastodon/reducers/relationships.js
index 1d050cc63..53949258a 100644
--- a/app/javascript/mastodon/reducers/relationships.js
+++ b/app/javascript/mastodon/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: