From 4a141e63636cba8123099e382629a98152bca4f4 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 16 Jan 2026 16:45:41 +0200 Subject: [PATCH] fix type errors --- src/components/moderation/ContentHider.tsx | 8 ++++++-- src/view/com/composer/labels/LabelsBtn.tsx | 8 ++++++-- src/view/com/composer/state/composer.ts | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/moderation/ContentHider.tsx b/src/components/moderation/ContentHider.tsx index 778c7e93ae..6ba98ff4d7 100644 --- a/src/components/moderation/ContentHider.tsx +++ b/src/components/moderation/ContentHider.tsx @@ -4,7 +4,11 @@ import {type ModerationUI} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {ADULT_CONTENT_LABELS, isJustAMute} from '#/lib/moderation' +import { + ADULT_CONTENT_LABELS, + type AdultSelfLabel, + isJustAMute, +} from '#/lib/moderation' import {useGlobalLabelStrings} from '#/lib/moderation/useGlobalLabelStrings' import {getDefinition, getLabelStrings} from '#/lib/moderation/useLabelInfo' import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription' @@ -101,7 +105,7 @@ function ContentHiderActive({ if (cause.source.type !== 'user') { return false } - if (ADULT_CONTENT_LABELS.includes(cause.label.val)) { + if (ADULT_CONTENT_LABELS.includes(cause.label.val as AdultSelfLabel)) { if (hasAdultContentLabel) { return false } diff --git a/src/view/com/composer/labels/LabelsBtn.tsx b/src/view/com/composer/labels/LabelsBtn.tsx index 6d897933b0..82a902c80c 100644 --- a/src/view/com/composer/labels/LabelsBtn.tsx +++ b/src/view/com/composer/labels/LabelsBtn.tsx @@ -33,7 +33,9 @@ export function LabelsBtn({ const updateAdultLabels = (newLabels: AdultSelfLabel[]) => { const newLabel = newLabels[newLabels.length - 1] - const filtered = labels.filter(l => !ADULT_CONTENT_LABELS.includes(l)) + const filtered = labels.filter( + l => !ADULT_CONTENT_LABELS.includes(l as AdultSelfLabel), + ) onChange([ ...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]), ]) @@ -41,7 +43,9 @@ export function LabelsBtn({ const updateOtherLabels = (newLabels: OtherSelfLabel[]) => { const newLabel = newLabels[newLabels.length - 1] - const filtered = labels.filter(l => !OTHER_SELF_LABELS.includes(l)) + const filtered = labels.filter( + l => !OTHER_SELF_LABELS.includes(l as OtherSelfLabel), + ) onChange([ ...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]), ]) diff --git a/src/view/com/composer/state/composer.ts b/src/view/com/composer/state/composer.ts index 12fd914f1c..7932378dab 100644 --- a/src/view/com/composer/state/composer.ts +++ b/src/view/com/composer/state/composer.ts @@ -297,7 +297,7 @@ export function composerReducer( initMention: undefined, initImageUris: [], initQuoteUri: undefined, - initInteractionSettings: action.postInteractionSettings, + initInteractionSettings: action.initInteractionSettings, }) } case 'mark_saved': {