Fix original mastodon bug

This commit is contained in:
KMY 2023-09-19 10:57:36 +09:00
parent 80fadeb766
commit dc6ad38474

View file

@ -75,7 +75,7 @@ export default function search(state = initialState, action) {
map.set('isLoading', false);
});
case SEARCH_EXPAND_REQUEST:
return state.set('type', action.searchType);
return state.set('type', action.searchType); // .set('isLoading', true); // original Mastodon bug
case SEARCH_EXPAND_SUCCESS:
const results = action.searchType === 'hashtags' ? ImmutableOrderedSet(fromJS(action.results.hashtags)) : action.results[action.searchType].map(item => item.id);
return state.updateIn(['results', action.searchType], list => list.union(results)).setIn(['noMoreResults', action.searchType], results.size <= 0);