Fix bell button causing a brief “Cancel follow request” on locked accounts (#14896)

lolsob-rspec
ThibG 2020-09-28 21:44:29 +02:00 committed by GitHub
parent e4739cfe1e
commit f53281dedb
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ const initialState = ImmutableMap();
export default function relationships(state = initialState, action) { export default function relationships(state = initialState, action) {
switch(action.type) { switch(action.type) {
case ACCOUNT_FOLLOW_REQUEST: 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: case ACCOUNT_FOLLOW_FAIL:
return state.setIn([action.id, action.locked ? 'requested' : 'following'], false); return state.setIn([action.id, action.locked ? 'requested' : 'following'], false);
case ACCOUNT_UNFOLLOW_REQUEST: case ACCOUNT_UNFOLLOW_REQUEST: