[Chat] Add chat disabled banner (#10573)

This commit is contained in:
Samuel Newman
2026-05-29 22:46:15 +03:00
committed by GitHub
parent b0708dcefb
commit d0ad7819bf
5 changed files with 137 additions and 51 deletions
+27
View File
@@ -0,0 +1,27 @@
import {useQuery} from '@tanstack/react-query'
import {DM_SERVICE_HEADERS} from '#/lib/constants'
import {useAgent} from '#/state/session'
import {STALE} from '..'
import {createQueryKey} from '../util'
const chatActorStatusQueryKey = () =>
createQueryKey('chat-actor-status', {}, {persistedVersion: 1})
export function useChatActorStatusQuery() {
const agent = useAgent()
return useQuery({
queryKey: chatActorStatusQueryKey(),
queryFn: async () => {
const {data} = await agent.chat.bsky.actor.getStatus(
{},
{headers: DM_SERVICE_HEADERS},
)
return data
},
staleTime: STALE.INFINITY,
gcTime: STALE.INFINITY,
})
}