Merge remote-tracking branch 'origin/kb_development' into kb_migration
This commit is contained in:
commit
1f388900a8
14 changed files with 341 additions and 13 deletions
|
@ -6,6 +6,14 @@ import {
|
|||
FAVOURITED_STATUSES_EXPAND_SUCCESS,
|
||||
FAVOURITED_STATUSES_EXPAND_FAIL,
|
||||
} from '../actions/favourites';
|
||||
import {
|
||||
EMOJI_REACTED_STATUSES_FETCH_REQUEST,
|
||||
EMOJI_REACTED_STATUSES_FETCH_SUCCESS,
|
||||
EMOJI_REACTED_STATUSES_FETCH_FAIL,
|
||||
EMOJI_REACTED_STATUSES_EXPAND_REQUEST,
|
||||
EMOJI_REACTED_STATUSES_EXPAND_SUCCESS,
|
||||
EMOJI_REACTED_STATUSES_EXPAND_FAIL,
|
||||
} from '../actions/emoji_reactions';
|
||||
import {
|
||||
BOOKMARKED_STATUSES_FETCH_REQUEST,
|
||||
BOOKMARKED_STATUSES_FETCH_SUCCESS,
|
||||
|
@ -29,6 +37,8 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutabl
|
|||
import {
|
||||
FAVOURITE_SUCCESS,
|
||||
UNFAVOURITE_SUCCESS,
|
||||
EMOJIREACT_SUCCESS,
|
||||
UNEMOJIREACT_SUCCESS,
|
||||
BOOKMARK_SUCCESS,
|
||||
UNBOOKMARK_SUCCESS,
|
||||
PIN_SUCCESS,
|
||||
|
@ -45,6 +55,11 @@ const initialState = ImmutableMap({
|
|||
loaded: false,
|
||||
items: ImmutableOrderedSet(),
|
||||
}),
|
||||
emoji_reactions: ImmutableMap({
|
||||
next: null,
|
||||
loaded: false,
|
||||
items: ImmutableOrderedSet(),
|
||||
}),
|
||||
bookmarks: ImmutableMap({
|
||||
next: null,
|
||||
loaded: false,
|
||||
|
@ -105,6 +120,16 @@ export default function statusLists(state = initialState, action) {
|
|||
return normalizeList(state, 'favourites', action.statuses, action.next);
|
||||
case FAVOURITED_STATUSES_EXPAND_SUCCESS:
|
||||
return appendToList(state, 'favourites', action.statuses, action.next);
|
||||
case EMOJI_REACTED_STATUSES_FETCH_REQUEST:
|
||||
case EMOJI_REACTED_STATUSES_EXPAND_REQUEST:
|
||||
return state.setIn(['emoji_reactions', 'isLoading'], true);
|
||||
case EMOJI_REACTED_STATUSES_FETCH_FAIL:
|
||||
case EMOJI_REACTED_STATUSES_EXPAND_FAIL:
|
||||
return state.setIn(['emoji_reactions', 'isLoading'], false);
|
||||
case EMOJI_REACTED_STATUSES_FETCH_SUCCESS:
|
||||
return normalizeList(state, 'emoji_reactions', action.statuses, action.next);
|
||||
case EMOJI_REACTED_STATUSES_EXPAND_SUCCESS:
|
||||
return appendToList(state, 'emoji_reactions', action.statuses, action.next);
|
||||
case BOOKMARKED_STATUSES_FETCH_REQUEST:
|
||||
case BOOKMARKED_STATUSES_EXPAND_REQUEST:
|
||||
return state.setIn(['bookmarks', 'isLoading'], true);
|
||||
|
@ -129,6 +154,10 @@ export default function statusLists(state = initialState, action) {
|
|||
return prependOneToList(state, 'favourites', action.status);
|
||||
case UNFAVOURITE_SUCCESS:
|
||||
return removeOneFromList(state, 'favourites', action.status);
|
||||
case EMOJIREACT_SUCCESS:
|
||||
return prependOneToList(state, 'emoji_reactions', action.status);
|
||||
case UNEMOJIREACT_SUCCESS:
|
||||
return removeOneFromList(state, 'emoji_reactions', action.status);
|
||||
case BOOKMARK_SUCCESS:
|
||||
return prependOneToList(state, 'bookmarks', action.status);
|
||||
case UNBOOKMARK_SUCCESS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue