This commit is contained in:
mgabdev
2020-04-17 01:35:46 -04:00
parent 35852e7fee
commit 4d7aee59c9
37 changed files with 568 additions and 319 deletions

View File

@@ -224,6 +224,7 @@ export default function notifications(state = initialState, action) {
case NOTIFICATIONS_FILTER_SET:
return state.withMutations(mutable => {
mutable.set('items', ImmutableList()).set('hasMore', true)
console.log("NOTIFICATIONS_FILTER_SET:", action.path, action.value)
mutable.setIn(['filter', action.path], action.value)
})
case NOTIFICATIONS_SCROLL_TOP:

View File

@@ -16,6 +16,7 @@ const initialState = ImmutableMap({
results: [],
chosenUrl: '',
searchText: '',
next: 0,
loading: false,
error: false,
})
@@ -27,7 +28,8 @@ export default function (state = initialState, action) {
return state.set('loading', true)
case GIF_RESULTS_FETCH_SUCCESS:
return state.withMutations(map => {
map.set('results', action.results);
map.set('results', action.data.results);
map.set('next', action.data.next);
map.set('error', false);
map.set('loading', false);
});