Update mutewords and hiddenposts to use the new sdk
This commit is contained in:
@@ -59,7 +59,7 @@ export function TagMenu({
|
||||
const displayTag = '#' + tag
|
||||
|
||||
const isMuted = Boolean(
|
||||
(preferences?.mutedWords?.find(
|
||||
(preferences?.moderationPrefs.mutedWords?.find(
|
||||
m => m.value === tag && m.targets.includes('tag'),
|
||||
) ??
|
||||
optimisticUpsert?.find(
|
||||
|
||||
@@ -50,7 +50,7 @@ export function TagMenu({
|
||||
const {mutateAsync: removeMutedWord, variables: optimisticRemove} =
|
||||
useRemoveMutedWordMutation()
|
||||
const isMuted = Boolean(
|
||||
(preferences?.mutedWords?.find(
|
||||
(preferences?.moderationPrefs.mutedWords?.find(
|
||||
m => m.value === tag && m.targets.includes('tag'),
|
||||
) ??
|
||||
optimisticUpsert?.find(
|
||||
|
||||
@@ -233,8 +233,8 @@ function MutedWordsInner({}: {control: Dialog.DialogOuterProps['control']}) {
|
||||
</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
) : preferences.mutedWords.length ? (
|
||||
[...preferences.mutedWords]
|
||||
) : preferences.moderationPrefs.mutedWords.length ? (
|
||||
[...preferences.moderationPrefs.mutedWords]
|
||||
.reverse()
|
||||
.map((word, i) => (
|
||||
<MutedWordRow
|
||||
|
||||
@@ -94,15 +94,12 @@ function ModerationDetailsDialogInner({
|
||||
name = _(msg`Account Muted`)
|
||||
description = _(msg`You have muted this user.`)
|
||||
}
|
||||
// TODO
|
||||
// } else if (cause.type === 'muted-word') {
|
||||
// return {
|
||||
// icon: EyeSlash,
|
||||
// name: _(msg`Post hidden by muted word`),
|
||||
// description: _(
|
||||
// msg`You've chosen to hide a word or tag within this post.`,
|
||||
// ),
|
||||
// }
|
||||
} else if (modcause.type === 'mute-word') {
|
||||
name = _(msg`Post Hidden by Muted Word`)
|
||||
description = _(msg`You've chosen to hide a word or tag within this post.`)
|
||||
} else if (modcause.type === 'hidden') {
|
||||
name = _(msg`Post Hidden by You`)
|
||||
description = _(msg`You have hidden this post.`)
|
||||
} else if (modcause.type === 'label') {
|
||||
name = desc.name
|
||||
description = desc.description
|
||||
|
||||
Reference in New Issue
Block a user