Handle muting correctly
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from 'react'
|
||||
import {
|
||||
ModerationCause,
|
||||
ModerationUI,
|
||||
LABEL_GROUPS,
|
||||
LabelGroupDefinition,
|
||||
AppBskyModerationDefs,
|
||||
@@ -22,6 +23,10 @@ export function getModerationCauseKey(cause: ModerationCause): string {
|
||||
return `${cause.type}:${source}`
|
||||
}
|
||||
|
||||
export function isJustAMute(modui: ModerationUI): boolean {
|
||||
return modui.filters.length === 1 && modui.filters[0].type === 'muted'
|
||||
}
|
||||
|
||||
export function getLabelGroupsFromLabels(labels: string[]) {
|
||||
const groups: LabelGroupDefinition[] = []
|
||||
|
||||
|
||||
@@ -58,18 +58,12 @@ export function useModerationCauseDescription(
|
||||
if (cause.type === 'muted') {
|
||||
if (cause.source.type === 'list') {
|
||||
return {
|
||||
name:
|
||||
context === 'account'
|
||||
? _(msg`Muted by "${cause.source.list.name}"`)
|
||||
: _(msg`Post by muted user ("${cause.source.list.name}")`),
|
||||
name: _(msg`Muted by "${cause.source.list.name}"`),
|
||||
description: _(msg`You have muted this user`),
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
name:
|
||||
context === 'account'
|
||||
? _(msg`Muted User`)
|
||||
: _(msg`Post by muted user`),
|
||||
name: _(msg`Muted User`),
|
||||
description: _(msg`You have muted this user`),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user