From 4b3ec54add3ddc4b6fc3a0045977c692bdb1842f Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 29 Nov 2023 11:15:35 -0800 Subject: Fix infinite query reloading behavior (reset, not invalidate) (#2031) * Reset, not invalidate, notification queries * Reset, not invalidate, feed queries --- src/lib/notifications/notifications.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/notifications/notifications.ts') diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 2320e1c7b..9c499be08 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -83,7 +83,7 @@ export function init(queryClient: QueryClient) { ) if (event.request.trigger.type === 'push') { // refresh notifications in the background - queryClient.invalidateQueries({queryKey: RQKEY_NOTIFS()}) + queryClient.resetQueries({queryKey: RQKEY_NOTIFS()}) // handle payload-based deeplinks let payload if (isIOS) { @@ -121,7 +121,7 @@ export function init(queryClient: QueryClient) { logger.DebugContext.notifications, ) track('Notificatons:OpenApp') - queryClient.invalidateQueries({queryKey: RQKEY_NOTIFS()}) + queryClient.resetQueries({queryKey: RQKEY_NOTIFS()}) resetToTab('NotificationsTab') // open notifications tab } }, -- cgit 1.4.1