Multiple notifications fixes (#2154)

* Dont reset notifications feed on push notification event

* Dont separate notifications by read state to avoid jank

* On notifications screen focus, check latest and only rerender if not scrolled down

* Reuse the cached notifs page when its not stale

* Bump ios build number

* Improve comments

* Change the 'mark all read' condition to avoid firing too early
This commit is contained in:
Paul Frazee 2023-12-09 15:09:31 -08:00 committed by GitHub
parent d854e88218
commit 6b3eb401b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 162 additions and 146 deletions

View file

@ -81,6 +81,7 @@ export function registerTokenChangeHandler(
export function init(queryClient: QueryClient) {
// handle notifications that are received, both in the foreground or background
// NOTE: currently just here for debug logging
Notifications.addNotificationReceivedListener(event => {
logger.debug(
'Notifications: received',
@ -88,8 +89,6 @@ export function init(queryClient: QueryClient) {
logger.DebugContext.notifications,
)
if (event.request.trigger.type === 'push') {
// refresh notifications in the background
truncateAndInvalidate(queryClient, RQKEY_NOTIFS())
// handle payload-based deeplinks
let payload
if (isIOS) {