Fix unlike counter, fixes #107

This commit is contained in:
Alex Gleason
2020-03-13 13:44:44 -05:00
parent 817063fd14
commit d78dd971c0
3 changed files with 14 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import {
REBLOG_FAIL,
FAVORITE_REQUEST,
FAVORITE_FAIL,
UNFAVORITE_REQUEST,
} from '../actions/interactions';
import {
STATUS_MUTE_SUCCESS,
@@ -39,6 +40,8 @@ export default function statuses(state = initialState, action) {
return state.setIn([action.status.get('id'), 'favourited'], true);
case FAVORITE_FAIL:
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false);
case UNFAVORITE_REQUEST:
return state.setIn([action.status.get('id'), 'favourited'], false);
case REBLOG_REQUEST:
return state.setIn([action.status.get('id'), 'reblogged'], true);
case REBLOG_FAIL: