diff --git a/src/state/queries/list-members.ts b/src/state/queries/list-members.ts index b02cc991..1aeb1bdd 100644 --- a/src/state/queries/list-members.ts +++ b/src/state/queries/list-members.ts @@ -19,8 +19,9 @@ const PAGE_SIZE = 30 type RQPageParam = string | undefined const RQKEY_ROOT = 'list-members' +const RQKEY_ROOT_ALL = 'list-members-all' export const RQKEY = (uri: string) => [RQKEY_ROOT, uri] -export const RQKEY_ALL = (uri: string) => [RQKEY_ROOT, uri, 'all'] +export const RQKEY_ALL = (uri: string) => [RQKEY_ROOT_ALL, uri] export function useListMembersQuery(uri?: string, limit: number = PAGE_SIZE) { const agent = useAgent() @@ -118,4 +119,20 @@ export function* findAllProfilesInQueryData( } } } + + const allQueryData = queryClient.getQueriesData< + AppBskyGraphDefs.ListItemView[] + >({ + queryKey: [RQKEY_ROOT_ALL], + }) + for (const [_queryKey, queryData] of allQueryData) { + if (!queryData) { + continue + } + for (const item of queryData) { + if (item.subject.did === did) { + yield item.subject + } + } + } }