aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-27 09:59:10 +0200
committerChocobozzz <me@florianbigard.com>2022-06-27 09:59:10 +0200
commit00fe5d61369b1769c62686e5bd8e6e666f867598 (patch)
tree1130aa8a764b9e2276344243290d93e84ff75baa /client/src/app/shared
parentb713976afbe47d06941222ad462bc68b3decd723 (diff)
downloadPeerTube-00fe5d61369b1769c62686e5bd8e6e666f867598.tar.gz
PeerTube-00fe5d61369b1769c62686e5bd8e6e666f867598.tar.zst
PeerTube-00fe5d61369b1769c62686e5bd8e6e666f867598.zip
Fix setting theme in client
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.html2
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.ts8
2 files changed, 5 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
index 1a24641a2..1e6e55e98 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
@@ -8,7 +8,7 @@
8 <option i18n value="instance-default">{{ instanceName }} default theme ({{ getDefaultInstanceThemeLabel() }})</option> 8 <option i18n value="instance-default">{{ instanceName }} default theme ({{ getDefaultInstanceThemeLabel() }})</option>
9 <option i18n value="default">{{ getDefaultThemeLabel() }}</option> 9 <option i18n value="default">{{ getDefaultThemeLabel() }}</option>
10 10
11 <option *ngFor="let theme of getAvailableThemes()" [value]="theme">{{ theme }}</option> 11 <option *ngFor="let theme of availableThemes" [value]="theme.id">{{ theme.label }}</option>
12 </select> 12 </select>
13 </div> 13 </div>
14 </div> 14 </div>
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
index 24ad54b1d..13e2e5424 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
@@ -3,6 +3,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'
3import { AuthService, Notifier, ServerService, ThemeService, UserService } from '@app/core' 3import { AuthService, Notifier, ServerService, ThemeService, UserService } from '@app/core'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models' 5import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models'
6import { SelectOptionsItem } from 'src/types'
6 7
7@Component({ 8@Component({
8 selector: 'my-user-interface-settings', 9 selector: 'my-user-interface-settings',
@@ -15,6 +16,7 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
15 @Input() notifyOnUpdate = true 16 @Input() notifyOnUpdate = true
16 @Input() userInformationLoaded: Subject<any> 17 @Input() userInformationLoaded: Subject<any>
17 18
19 availableThemes: SelectOptionsItem[]
18 formValuesWatcher: Subscription 20 formValuesWatcher: Subscription
19 21
20 private serverConfig: HTMLServerConfig 22 private serverConfig: HTMLServerConfig
@@ -37,6 +39,8 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
37 ngOnInit () { 39 ngOnInit () {
38 this.serverConfig = this.serverService.getHTMLConfig() 40 this.serverConfig = this.serverService.getHTMLConfig()
39 41
42 this.availableThemes = this.themeService.buildAvailableThemes()
43
40 this.buildForm({ 44 this.buildForm({
41 theme: null 45 theme: null
42 }) 46 })
@@ -61,10 +65,6 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
61 return this.themeService.getDefaultThemeLabel() 65 return this.themeService.getDefaultThemeLabel()
62 } 66 }
63 67
64 getAvailableThemes () {
65 return this.themeService.getAvailableThemeLabels()
66 }
67
68 getDefaultInstanceThemeLabel () { 68 getDefaultInstanceThemeLabel () {
69 const theme = this.serverConfig.theme.default 69 const theme = this.serverConfig.theme.default
70 70