diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-04 13:31:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-04 15:45:44 +0200 |
commit | 2989628b7913383b39ac34c7db8666a21f8e5037 (patch) | |
tree | ac7759177c04e524e7845143fd685aefb49e810e /client/src/app/shared/shared-actor-image-edit | |
parent | 8e08d415f9473b6b72fef698729453e726da16e7 (diff) | |
download | PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.gz PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.zst PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.zip |
Use HTML config when possible
Diffstat (limited to 'client/src/app/shared/shared-actor-image-edit')
-rw-r--r-- | client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | 15 | ||||
-rw-r--r-- | client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.ts | 15 |
2 files changed, 14 insertions, 16 deletions
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts index 840946690..dc9b72ddb 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts +++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.ts | |||
@@ -39,14 +39,13 @@ export class ActorAvatarEditComponent implements OnInit { | |||
39 | ) { } | 39 | ) { } |
40 | 40 | ||
41 | ngOnInit (): void { | 41 | ngOnInit (): void { |
42 | this.serverService.getConfig() | 42 | const config = this.serverService.getHTMLConfig() |
43 | .subscribe(config => { | 43 | |
44 | this.maxAvatarSize = config.avatar.file.size.max | 44 | this.maxAvatarSize = config.avatar.file.size.max |
45 | this.avatarExtensions = config.avatar.file.extensions.join(', ') | 45 | this.avatarExtensions = config.avatar.file.extensions.join(', ') |
46 | 46 | ||
47 | this.avatarFormat = `${$localize`max size`}: 192*192px, ` + | 47 | this.avatarFormat = `${$localize`max size`}: 192*192px, ` + |
48 | `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}` | 48 | `${getBytes(this.maxAvatarSize)} ${$localize`extensions`}: ${this.avatarExtensions}` |
49 | }) | ||
50 | } | 49 | } |
51 | 50 | ||
52 | onAvatarChange (input: HTMLInputElement) { | 51 | onAvatarChange (input: HTMLInputElement) { |
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.ts b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.ts index 08372d8ad..eec325a61 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.ts +++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' | 2 | import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' |
3 | import { Notifier, ServerService } from '@app/core' | 3 | import { Notifier, ServerService } from '@app/core' |
4 | import { VideoChannel } from '@app/shared/shared-main' | 4 | import { VideoChannel } from '@app/shared/shared-main' |
@@ -36,16 +36,15 @@ export class ActorBannerEditComponent implements OnInit { | |||
36 | ) { } | 36 | ) { } |
37 | 37 | ||
38 | ngOnInit (): void { | 38 | ngOnInit (): void { |
39 | this.serverService.getConfig() | 39 | const config = this.serverService.getHTMLConfig() |
40 | .subscribe(config => { | 40 | this.maxBannerSize = config.banner.file.size.max |
41 | this.maxBannerSize = config.banner.file.size.max | 41 | this.bannerExtensions = config.banner.file.extensions.join(', ') |
42 | this.bannerExtensions = config.banner.file.extensions.join(', ') | ||
43 | 42 | ||
44 | // tslint:disable:max-line-length | 43 | // tslint:disable:max-line-length |
45 | this.bannerFormat = $localize`ratio 6/1, recommended size: 1920x317, max size: ${getBytes(this.maxBannerSize)}, extensions: ${this.bannerExtensions}` | 44 | this.bannerFormat = $localize`ratio 6/1, recommended size: 1920x317, max size: ${getBytes(this.maxBannerSize)}, extensions: ${this.bannerExtensions}` |
46 | }) | ||
47 | } | 45 | } |
48 | 46 | ||
47 | |||
49 | onBannerChange (input: HTMLInputElement) { | 48 | onBannerChange (input: HTMLInputElement) { |
50 | this.bannerfileInput = new ElementRef(input) | 49 | this.bannerfileInput = new ElementRef(input) |
51 | 50 | ||