about summary refs log tree commit diff
path: root/src/lib/notifications/notifications.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-09 15:09:31 -0800
committerGitHub <noreply@github.com>2023-12-09 15:09:31 -0800
commit6b3eb401b04ee442005a9690dcf90e16d46c35e0 (patch)
tree536ed44b8b7f436e4144573dedef8d41c7cb3801 /src/lib/notifications/notifications.ts
parentd854e882187c4358ae3b4c1fb9d1324f5fe215e4 (diff)
downloadvoidsky-6b3eb401b04ee442005a9690dcf90e16d46c35e0.tar.zst
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
Diffstat (limited to 'src/lib/notifications/notifications.ts')
-rw-r--r--src/lib/notifications/notifications.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts
index d115dc98f..342839a7b 100644
--- a/src/lib/notifications/notifications.ts
+++ b/src/lib/notifications/notifications.ts
@@ -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) {