diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-04 00:55:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-04 00:55:33 -0500 |
commit | ab3074fdee44103424a58577f5c81c9d2436fc68 (patch) | |
tree | a494ee4fc5d07cf5ec4f162e4f5e0c23a449c13f /src/state/models/ui/preferences.ts | |
parent | 33bf9c38695c24ede28d68810d1f6b2e68f86f5f (diff) | |
download | voidsky-ab3074fdee44103424a58577f5c81c9d2436fc68.tar.zst |
Add the !filter and !warn imperative labels (#580)
Diffstat (limited to 'src/state/models/ui/preferences.ts')
-rw-r--r-- | src/state/models/ui/preferences.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/models/ui/preferences.ts b/src/state/models/ui/preferences.ts index f6b29169d..7b41fa746 100644 --- a/src/state/models/ui/preferences.ts +++ b/src/state/models/ui/preferences.ts @@ -4,7 +4,12 @@ import {isObj, hasProp} from 'lib/type-guards' import {ComAtprotoLabelDefs} from '@atproto/api' import {LabelValGroup} from 'lib/labeling/types' import {getLabelValueGroup} from 'lib/labeling/helpers' -import {UNKNOWN_LABEL_GROUP, ILLEGAL_LABEL_GROUP} from 'lib/labeling/const' +import { + UNKNOWN_LABEL_GROUP, + ILLEGAL_LABEL_GROUP, + ALWAYS_FILTER_LABEL_GROUP, + ALWAYS_WARN_LABEL_GROUP, +} from 'lib/labeling/const' const deviceLocales = getLocales() @@ -94,6 +99,10 @@ export class PreferencesModel { const group = getLabelValueGroup(label.val) if (group.id === 'illegal') { return {pref: 'hide', desc: ILLEGAL_LABEL_GROUP} + } else if (group.id === 'always-filter') { + return {pref: 'hide', desc: ALWAYS_FILTER_LABEL_GROUP} + } else if (group.id === 'always-warn') { + return {pref: 'warn', desc: ALWAYS_WARN_LABEL_GROUP} } else if (group.id === 'unknown') { continue } |