fix type errors

This commit is contained in:
Samuel Newman
2026-01-16 16:45:41 +02:00
parent 9fcaa8ff39
commit 4a141e6363
3 changed files with 13 additions and 5 deletions
+6 -2
View File
@@ -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
}
+6 -2
View File
@@ -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[]),
])
+1 -1
View File
@@ -297,7 +297,7 @@ export function composerReducer(
initMention: undefined,
initImageUris: [],
initQuoteUri: undefined,
initInteractionSettings: action.postInteractionSettings,
initInteractionSettings: action.initInteractionSettings,
})
}
case 'mark_saved': {