[Glitch] Revert "Change timelines to add new items to pending items when scrolled down #11867"

Port 8c4b5f7cef to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko
2019-09-23 00:48:31 +02:00
committed by Thibaut Girka
parent e25b7feb72
commit 5c9ba9177a
2 changed files with 5 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ const notificationToMap = (state, notification) => ImmutableMap({
const normalizeNotification = (state, notification, usePendingItems) => {
const top = !shouldCountUnreadNotifications(state);
if (usePendingItems || !top || !state.get('pendingItems').isEmpty()) {
if (usePendingItems || !state.get('pendingItems').isEmpty()) {
return state.update('pendingItems', list => list.unshift(notificationToMap(state, notification))).update('unread', unread => unread + 1);
}
@@ -82,7 +82,7 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
return state.withMutations(mutable => {
if (!items.isEmpty()) {
usePendingItems = isLoadingRecent && (usePendingItems || !mutable.get('top') || !mutable.get('pendingItems').isEmpty());
usePendingItems = isLoadingRecent && (usePendingItems || !mutable.get('pendingItems').isEmpty());
mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
const lastIndex = 1 + list.findLastIndex(