]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
Fix setting theme in client
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-user-settings / user-interface-settings.component.ts
index 24ad54b1d0942841a6929c8af478fe20c2aa1512..13e2e54248de6723592d28a3dc7f30bc4bba2cbc 100644 (file)
@@ -3,6 +3,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'
 import { AuthService, Notifier, ServerService, ThemeService, UserService } from '@app/core'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
 import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models'
+import { SelectOptionsItem } from 'src/types'
 
 @Component({
   selector: 'my-user-interface-settings',
@@ -15,6 +16,7 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
   @Input() notifyOnUpdate = true
   @Input() userInformationLoaded: Subject<any>
 
+  availableThemes: SelectOptionsItem[]
   formValuesWatcher: Subscription
 
   private serverConfig: HTMLServerConfig
@@ -37,6 +39,8 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
   ngOnInit () {
     this.serverConfig = this.serverService.getHTMLConfig()
 
+    this.availableThemes = this.themeService.buildAvailableThemes()
+
     this.buildForm({
       theme: null
     })
@@ -61,10 +65,6 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
     return this.themeService.getDefaultThemeLabel()
   }
 
-  getAvailableThemes () {
-    return this.themeService.getAvailableThemeLabels()
-  }
-
   getDefaultInstanceThemeLabel () {
     const theme = this.serverConfig.theme.default