An ATproto social media client -- with an independent Appview.

ensure mod service header present for appeals (#9025)

authored by

hailey and committed by
GitHub
836d16fe 58ffe365

+18 -9
+18 -9
src/screens/Takendown.tsx
··· 9 9 import {useMutation} from '@tanstack/react-query' 10 10 import Graphemer from 'graphemer' 11 11 12 - import {MAX_REPORT_REASON_GRAPHEME_LENGTH} from '#/lib/constants' 12 + import { 13 + BLUESKY_MOD_SERVICE_HEADERS, 14 + MAX_REPORT_REASON_GRAPHEME_LENGTH, 15 + } from '#/lib/constants' 13 16 import {useEnableKeyboardController} from '#/lib/hooks/useEnableKeyboardController' 14 17 import {cleanError} from '#/lib/strings/errors' 15 18 import {isIOS, isWeb} from '#/platform/detection' ··· 49 52 } = useMutation({ 50 53 mutationFn: async (appealText: string) => { 51 54 if (!currentAccount) throw new Error('No session') 52 - await agent.com.atproto.moderation.createReport({ 53 - reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 54 - subject: { 55 - $type: 'com.atproto.admin.defs#repoRef', 56 - did: currentAccount.did, 57 - } satisfies ComAtprotoAdminDefs.RepoRef, 58 - reason: appealText, 59 - }) 55 + await agent.com.atproto.moderation.createReport( 56 + { 57 + reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 58 + subject: { 59 + $type: 'com.atproto.admin.defs#repoRef', 60 + did: currentAccount.did, 61 + } satisfies ComAtprotoAdminDefs.RepoRef, 62 + reason: appealText, 63 + }, 64 + { 65 + encoding: 'application/json', 66 + headers: BLUESKY_MOD_SERVICE_HEADERS, 67 + }, 68 + ) 60 69 }, 61 70 onSuccess: () => setReason(''), 62 71 })