Open details if Other is selected

This commit is contained in:
Eric Bailey
2025-02-24 14:39:22 -06:00
parent a336d6aa08
commit 300079488b
@@ -1,4 +1,4 @@
import {AppBskyLabelerDefs} from '@atproto/api' import {AppBskyLabelerDefs, ComAtprotoModerationDefs} from '@atproto/api'
import {ReportOption} from './utils/useReportOptions' import {ReportOption} from './utils/useReportOptions'
@@ -56,6 +56,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState {
...state, ...state,
selectedOption: action.option, selectedOption: action.option,
activeStepIndex1: 2, activeStepIndex1: 2,
detailsOpen:
!!state.details ||
action.option.reason === ComAtprotoModerationDefs.REASONOTHER,
} }
case 'clearOption': case 'clearOption':
return { return {
@@ -63,7 +66,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState {
selectedOption: undefined, selectedOption: undefined,
selectedLabeler: undefined, selectedLabeler: undefined,
activeStepIndex1: 1, activeStepIndex1: 1,
detailsOpen: !!state.details, detailsOpen:
!!state.details ||
state.selectedOption?.reason === ComAtprotoModerationDefs.REASONOTHER,
} }
case 'selectLabeler': case 'selectLabeler':
return { return {
@@ -76,7 +81,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState {
...state, ...state,
selectedLabeler: undefined, selectedLabeler: undefined,
activeStepIndex1: 2, activeStepIndex1: 2,
detailsOpen: !!state.details, detailsOpen:
!!state.details ||
state.selectedOption?.reason === ComAtprotoModerationDefs.REASONOTHER,
} }
case 'setDetails': case 'setDetails':
return { return {