Fix infinite scrolling breaking after navigation

This commit is contained in:
Eugen Rochko 2017-02-19 21:37:04 +01:00
parent 4aa5ebe591
commit c50256d25c
3 changed files with 11 additions and 4 deletions

View file

@ -37,9 +37,12 @@ const normalizeNotifications = (state, notifications, next) => {
items = items.set(i, notificationToMap(n));
});
if (state.get('next') === null) {
state = state.set('next', next);
}
return state
.update('items', list => loaded ? list.unshift(...items) : list.push(...items))
.set('next', next)
.set('loaded', true)
.set('isLoading', false);
};