) { }
ngOnInit (): void {
- this.serverService.getConfig()
- .subscribe(config => {
- this.maxAvatarSize = config.avatar.file.size.max
- this.avatarExtensions = config.avatar.file.extensions.join(', ')
-
- this.avatarFormat = `${$localize`max size`}: 192*192px, ` +
- `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}`
- })
+ const config = this.serverService.getHTMLConfig()
+
+ this.maxAvatarSize = config.avatar.file.size.max
+ this.avatarExtensions = config.avatar.file.extensions.join(', ')
+
+ this.avatarFormat = `${$localize`max size`}: 192*192px, ` +
+ `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}`
}
onAvatarChange (input: HTMLInputElement) {
isChannel () {
return !!(this.actor as VideoChannel).ownerAccount
}
+
+ getChannel (): VideoChannel {
+ if (this.isChannel()) return this.actor as VideoChannel
+
+ return undefined
+ }
+
+ getAccount (): Account {
+ if (this.isChannel()) return undefined
+
+ return this.actor as Account
+ }
}