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

@ -55,6 +55,7 @@ import {cleanError} from '#/lib/strings/errors'
import {useSession} from '#/state/session'
import {useComposerControls} from '#/state/shell/composer'
import {isWeb} from '#/platform/detection'
import {truncateAndInvalidate} from '#/state/queries/util'
const SECTION_TITLES_CURATE = ['Posts', 'About']
const SECTION_TITLES_MOD = ['About']
@ -128,10 +129,8 @@ function ProfileListScreenLoaded({
list,
onChange() {
if (isCurateList) {
queryClient.resetQueries({
// TODO(eric) should construct these strings with a fn too
queryKey: FEED_RQKEY(`list|${list.uri}`),
})
// TODO(eric) should construct these strings with a fn too
truncateAndInvalidate(queryClient, FEED_RQKEY(`list|${list.uri}`))
}
},
})