fix type errors
This commit is contained in:
@@ -4,7 +4,11 @@ import {type ModerationUI} from '@atproto/api'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
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 {useGlobalLabelStrings} from '#/lib/moderation/useGlobalLabelStrings'
|
||||||
import {getDefinition, getLabelStrings} from '#/lib/moderation/useLabelInfo'
|
import {getDefinition, getLabelStrings} from '#/lib/moderation/useLabelInfo'
|
||||||
import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription'
|
import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription'
|
||||||
@@ -101,7 +105,7 @@ function ContentHiderActive({
|
|||||||
if (cause.source.type !== 'user') {
|
if (cause.source.type !== 'user') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (ADULT_CONTENT_LABELS.includes(cause.label.val)) {
|
if (ADULT_CONTENT_LABELS.includes(cause.label.val as AdultSelfLabel)) {
|
||||||
if (hasAdultContentLabel) {
|
if (hasAdultContentLabel) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ export function LabelsBtn({
|
|||||||
|
|
||||||
const updateAdultLabels = (newLabels: AdultSelfLabel[]) => {
|
const updateAdultLabels = (newLabels: AdultSelfLabel[]) => {
|
||||||
const newLabel = newLabels[newLabels.length - 1]
|
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([
|
onChange([
|
||||||
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
||||||
])
|
])
|
||||||
@@ -41,7 +43,9 @@ export function LabelsBtn({
|
|||||||
|
|
||||||
const updateOtherLabels = (newLabels: OtherSelfLabel[]) => {
|
const updateOtherLabels = (newLabels: OtherSelfLabel[]) => {
|
||||||
const newLabel = newLabels[newLabels.length - 1]
|
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([
|
onChange([
|
||||||
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ export function composerReducer(
|
|||||||
initMention: undefined,
|
initMention: undefined,
|
||||||
initImageUris: [],
|
initImageUris: [],
|
||||||
initQuoteUri: undefined,
|
initQuoteUri: undefined,
|
||||||
initInteractionSettings: action.postInteractionSettings,
|
initInteractionSettings: action.initInteractionSettings,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case 'mark_saved': {
|
case 'mark_saved': {
|
||||||
|
|||||||
Reference in New Issue
Block a user