Feed and notifs improvements (#498)
* Reduce frequency of the notifications sync * Reduce frequency of home feed polling * Ensure loading spinner is visible in notifications * Render notifications loading spinner in the flatlist * Fixes and performance improvements to notifications * Render 30+ on notifications if at max * Fix issue with repeating posts in home feed * Dont check for unread notifs if we're already at max
This commit is contained in:
@@ -38,8 +38,8 @@ export const NotificationsScreen = withAuthRequired(
|
||||
}, [scrollElRef])
|
||||
|
||||
const onPressLoadLatest = React.useCallback(() => {
|
||||
store.me.notifications.processQueue()
|
||||
scrollToTop()
|
||||
store.me.notifications.refresh()
|
||||
}, [store, scrollToTop])
|
||||
|
||||
// on-visible setup
|
||||
@@ -49,13 +49,12 @@ export const NotificationsScreen = withAuthRequired(
|
||||
store.shell.setMinimalShellMode(false)
|
||||
store.log.debug('NotificationsScreen: Updating feed')
|
||||
const softResetSub = store.onScreenSoftReset(onPressLoadLatest)
|
||||
store.me.notifications.syncQueue()
|
||||
store.me.notifications.update()
|
||||
screen('Notifications')
|
||||
|
||||
return () => {
|
||||
softResetSub.remove()
|
||||
store.me.notifications.markAllUnqueuedRead()
|
||||
store.me.notifications.markAllRead()
|
||||
}
|
||||
}, [store, screen, onPressLoadLatest]),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user