hasMore: state.getIn(['notifications', 'hasMore']),
numPending: state.getIn(['notifications', 'pendingItems'], ImmutableList()).size,
notifCleaningActive: state.getIn(['notifications', 'cleaningMode']),
- lastReadId: state.getIn(['notifications', 'lastReadId']),
+ lastReadId: state.getIn(['notifications', 'readMarkerId']),
});
/* glitch */
accountId={item.get('account')}
onMoveUp={this.handleMoveUp}
onMoveDown={this.handleMoveDown}
- unread={lastReadId && compareId(item.get('id'), lastReadId) > 0}
+ unread={lastReadId !== '0' && compareId(item.get('id'), lastReadId) > 0}
/>
));
} else {
mounted: 0,
unread: 0,
lastReadId: '0',
+ readMarkerId: '0',
isLoading: false,
cleaningMode: false,
isTabVisible: true,
const updateMounted = (state) => {
state = state.update('mounted', count => count + 1);
if (!shouldCountUnreadNotifications(state)) {
+ state = state.set('readMarkerId', state.get('lastReadId'));
state = clearUnread(state);
}
return state;
const updateVisibility = (state, visibility) => {
state = state.set('isTabVisible', visibility);
if (!shouldCountUnreadNotifications(state)) {
+ state = state.set('readMarkerId', state.get('lastReadId'));
state = clearUnread(state);
}
return state;
mutable.set('lastReadId', last_read_id);
}
+ if (compareId(last_read_id, mutable.get('readMarkerId')) > 0) {
+ mutable.set('readMarkerId', last_read_id);
+ }
+
if (state.get('unread') > 0 || shouldCountUnreadNotifications(state)) {
mutable.set('unread', mutable.get('pendingItems').count(item => item !== null) + mutable.get('items').count(item => item && compareId(item.get('id'), last_read_id) > 0));
}