diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-30 18:49:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 18:49:23 -0800 |
commit | 826cbbd4bf3a9a3cfb87b6dedee630e915b07b27 (patch) | |
tree | 36bdc8edbe3fafc2b1ce780f5a70788eaf97524f /src/lib | |
parent | 9fa90bb8d97db5078aedaa359d4b956d67e31ada (diff) | |
download | voidsky-826cbbd4bf3a9a3cfb87b6dedee630e915b07b27.tar.zst |
Maintain some feed data to avoid needless glimmers (#2054)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/notifications/notifications.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 9c499be08..6e79e6b91 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -5,6 +5,7 @@ import {devicePlatform, isIOS} from 'platform/detection' import {track} from 'lib/analytics/analytics' import {logger} from '#/logger' import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed' +import {truncateAndInvalidate} from '#/state/queries/util' import {listenSessionLoaded} from '#/state/events' const SERVICE_DID = (serviceUrl?: string) => @@ -83,7 +84,7 @@ export function init(queryClient: QueryClient) { ) if (event.request.trigger.type === 'push') { // refresh notifications in the background - queryClient.resetQueries({queryKey: RQKEY_NOTIFS()}) + truncateAndInvalidate(queryClient, RQKEY_NOTIFS()) // handle payload-based deeplinks let payload if (isIOS) { @@ -121,7 +122,7 @@ export function init(queryClient: QueryClient) { logger.DebugContext.notifications, ) track('Notificatons:OpenApp') - queryClient.resetQueries({queryKey: RQKEY_NOTIFS()}) + truncateAndInvalidate(queryClient, RQKEY_NOTIFS()) resetToTab('NotificationsTab') // open notifications tab } }, |