Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import {type AppBskyActorDefs} from '@atproto/api'import {useMutation, useQueryClient} from '@tanstack/react-query'
import {preferencesQueryKey} from '#/state/queries/preferences'import {useAgent} from '#/state/session'
export function usePostInteractionSettingsMutation({ onError, onSettled,}: { onError?: (error: Error) => void onSettled?: () => void} = {}) { const qc = useQueryClient() const agent = useAgent() return useMutation({ async mutationFn(props: AppBskyActorDefs.PostInteractionSettingsPref) { await agent.setPostInteractionSettings(props) }, async onSuccess() { await qc.invalidateQueries({ queryKey: preferencesQueryKey, }) }, onError, onSettled, })}