Maintain some feed data to avoid needless glimmers (#2054)

This commit is contained in:
Paul Frazee 2023-11-30 18:49:23 -08:00 committed by GitHub
parent 9fa90bb8d9
commit 826cbbd4bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 40 additions and 23 deletions

View file

@ -53,6 +53,7 @@ import {emitSoftReset} from '#/state/events'
import {useInviteCodesQuery} from '#/state/queries/invites'
import {RQKEY as NOTIFS_RQKEY} from '#/state/queries/notifications/feed'
import {NavSignupCard} from '#/view/shell/NavSignupCard'
import {truncateAndInvalidate} from '#/state/queries/util'
export function DrawerProfileCard({
account,
@ -141,9 +142,7 @@ export function DrawerContent() {
} else {
if (tab === 'Notifications') {
// fetch new notifs on view
queryClient.resetQueries({
queryKey: NOTIFS_RQKEY(),
})
truncateAndInvalidate(queryClient, NOTIFS_RQKEY())
}
// @ts-ignore must be Home, Search, Notifications, or MyProfile
navigation.navigate(`${tab}Tab`)