diff options
Diffstat (limited to 'src/state/models/content/profile.ts')
-rw-r--r-- | src/state/models/content/profile.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/state/models/content/profile.ts b/src/state/models/content/profile.ts index c26dc8749..ea75d19c6 100644 --- a/src/state/models/content/profile.ts +++ b/src/state/models/content/profile.ts @@ -10,6 +10,12 @@ import * as apilib from 'lib/api/index' import {cleanError} from 'lib/strings/errors' import {FollowState} from '../cache/my-follows' import {Image as RNImage} from 'react-native-image-crop-picker' +import {ProfileLabelInfo, ProfileModeration} from 'lib/labeling/types' +import { + getProfileModeration, + filterAccountLabels, + filterProfileLabels, +} from 'lib/labeling/helpers' export const ACTOR_TYPE_USER = 'app.bsky.system.actorUser' @@ -75,6 +81,18 @@ export class ProfileModel { return this.hasLoaded && !this.hasContent } + get labelInfo(): ProfileLabelInfo { + return { + accountLabels: filterAccountLabels(this.labels), + profileLabels: filterProfileLabels(this.labels), + isMuted: this.viewer?.muted || false, + } + } + + get moderation(): ProfileModeration { + return getProfileModeration(this.rootStore, this.labelInfo) + } + // public api // = |