From 300079488bd1eceb6ef6b839e0f568ff85d3e6d6 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 24 Feb 2025 14:39:22 -0600 Subject: [PATCH] Open details if Other is selected --- src/components/moderation/ReportDialog/state.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/moderation/ReportDialog/state.ts b/src/components/moderation/ReportDialog/state.ts index 18cd3a4af2..3f55bfb01a 100644 --- a/src/components/moderation/ReportDialog/state.ts +++ b/src/components/moderation/ReportDialog/state.ts @@ -1,4 +1,4 @@ -import {AppBskyLabelerDefs} from '@atproto/api' +import {AppBskyLabelerDefs, ComAtprotoModerationDefs} from '@atproto/api' import {ReportOption} from './utils/useReportOptions' @@ -56,6 +56,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState { ...state, selectedOption: action.option, activeStepIndex1: 2, + detailsOpen: + !!state.details || + action.option.reason === ComAtprotoModerationDefs.REASONOTHER, } case 'clearOption': return { @@ -63,7 +66,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState { selectedOption: undefined, selectedLabeler: undefined, activeStepIndex1: 1, - detailsOpen: !!state.details, + detailsOpen: + !!state.details || + state.selectedOption?.reason === ComAtprotoModerationDefs.REASONOTHER, } case 'selectLabeler': return { @@ -76,7 +81,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState { ...state, selectedLabeler: undefined, activeStepIndex1: 2, - detailsOpen: !!state.details, + detailsOpen: + !!state.details || + state.selectedOption?.reason === ComAtprotoModerationDefs.REASONOTHER, } case 'setDetails': return {