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/view/screens/Notifications.tsx | |
parent | 9fa90bb8d97db5078aedaa359d4b956d67e31ada (diff) | |
download | voidsky-826cbbd4bf3a9a3cfb87b6dedee630e915b07b27.tar.zst |
Maintain some feed data to avoid needless glimmers (#2054)
Diffstat (limited to 'src/view/screens/Notifications.tsx')
-rw-r--r-- | src/view/screens/Notifications.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx index 0f442038b..3ce1128a6 100644 --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -25,6 +25,7 @@ import { } from '#/state/queries/notifications/unread' import {RQKEY as NOTIFS_RQKEY} from '#/state/queries/notifications/feed' import {listenSoftReset, emitSoftReset} from '#/state/events' +import {truncateAndInvalidate} from '#/state/queries/util' type Props = NativeStackScreenProps< NotificationsTabNavigatorParams, @@ -54,9 +55,7 @@ export function NotificationsScreen({}: Props) { scrollToTop() if (hasNew) { // render what we have now - queryClient.resetQueries({ - queryKey: NOTIFS_RQKEY(), - }) + truncateAndInvalidate(queryClient, NOTIFS_RQKEY()) } else { // check with the server unreadApi.checkUnread({invalidate: true}) |