This commit is contained in:
mgabdev
2020-03-03 22:45:16 -05:00
parent 0df3c073a5
commit 33952e424f
127 changed files with 765 additions and 3588 deletions

View File

@@ -59,10 +59,14 @@ const normalizeNotification = (state, notification) => {
const expandNormalizedNotifications = (state, notifications, next) => {
let items = ImmutableList();
// : todo filter notiications here:
notifications.forEach((n, i) => {
items = items.set(i, notificationToMap(n));
});
console.log("reducer notifications:", notifications)
return state.withMutations(mutable => {
if (!items.isEmpty()) {
mutable.update('items', list => {
@@ -74,7 +78,9 @@ const expandNormalizedNotifications = (state, notifications, next) => {
item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0
);
return list.take(firstIndex).concat(items, list.skip(lastIndex));
const pop = list.take(firstIndex).concat(items, list.skip(lastIndex));
console.log("pop:", pop)
return pop
});
}