[Chat] Remove convoState dependency from header (#10293)

This commit is contained in:
Samuel Newman
2026-04-18 12:58:16 -07:00
committed by GitHub
parent 35411e88c9
commit bc3672ceeb
7 changed files with 66 additions and 142 deletions
+4 -5
View File
@@ -19,19 +19,18 @@ import {
const RQKEY_ROOT = 'convo'
export const RQKEY = (convoId: string) => [RQKEY_ROOT, convoId]
export function useConvoQuery(convo: ChatBskyConvoDefs.ConvoView) {
export function useConvoQuery({convoId}: {convoId: string}) {
const agent = useAgent()
return useQuery({
queryKey: RQKEY(convo.id),
queryKey: RQKEY(convoId),
queryFn: async () => {
const {data} = await agent.chat.bsky.convo.getConvo(
{convoId: convo.id},
{convoId},
{headers: DM_SERVICE_HEADERS},
)
return data.convo
},
initialData: convo,
staleTime: STALE.INFINITY,
})
}
@@ -58,7 +57,7 @@ export function useMarkAsReadMutation() {
}) => {
if (!convoId) throw new Error('No convoId provided')
await agent.api.chat.bsky.convo.updateRead(
await agent.chat.bsky.convo.updateRead(
{
convoId,
messageId,