Update the reporting flow to first select a recipient if the user has multiple labelers (#3258)

This commit is contained in:
Paul Frazee 2024-03-18 16:15:57 -07:00 committed by GitHub
parent 1b10c7bc08
commit 959121f394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 175 additions and 20 deletions

View file

@ -24,11 +24,13 @@ import {getAgent} from '#/state/session'
export function SubmitView({
params,
labelers,
selectedLabeler,
selectedReportOption,
goBack,
onSubmitComplete,
}: ReportDialogProps & {
labelers: AppBskyLabelerDefs.LabelerViewDetailed[]
selectedLabeler: string
selectedReportOption: ReportOption
goBack: () => void
onSubmitComplete: () => void
@ -37,9 +39,9 @@ export function SubmitView({
const {_} = useLingui()
const [details, setDetails] = React.useState<string>('')
const [submitting, setSubmitting] = React.useState<boolean>(false)
const [selectedServices, setSelectedServices] = React.useState<string[]>(
labelers?.map(labeler => labeler.creator.did) || [],
)
const [selectedServices, setSelectedServices] = React.useState<string[]>([
selectedLabeler,
])
const [error, setError] = React.useState('')
const submit = React.useCallback(async () => {