import { Account } from '@app/shared/shared-main/account/account.model'
+import { hasUserRight } from '@shared/core-utils/users'
import {
- Avatar,
- hasUserRight,
+ ActorImage,
NSFWPolicyType,
User as UserServerModel,
UserAdminFlag,
UserRole,
VideoChannel
} from '@shared/models'
-import { UserKeys } from '@root-helpers/user-keys'
export class User implements UserServerModel {
- static KEYS = UserKeys
-
id: number
username: string
email: string
}
}
- get accountAvatarUrl () {
- if (!this.account) return ''
-
- return this.account.avatarUrl
- }
-
hasRight (right: UserRight) {
return hasUserRight(this.role, right)
}
}
}
- updateAccountAvatar (newAccountAvatar: Avatar) {
- this.account.updateAvatar(newAccountAvatar)
+ updateAccountAvatar (newAccountAvatar?: ActorImage) {
+ if (newAccountAvatar) this.account.updateAvatar(newAccountAvatar)
+ else this.account.resetAvatar()
}
isUploadDisabled () {