From ba430d7516bc5b1324b60571ba7594460969b7fb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Dec 2019 15:31:54 +0100 Subject: Lazy load static objects --- .../my-account-interface-settings.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'client/src/app/+my-account/my-account-settings/my-account-interface') diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts index 5ec1c9f8f..441f89f10 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core' import { Notifier, ServerService } from '@app/core' -import { UserUpdateMe } from '../../../../../../shared' +import { ServerConfig, UserUpdateMe } from '../../../../../../shared' import { AuthService } from '../../../core' import { FormReactive, User, UserService } from '../../../shared' import { I18n } from '@ngx-translate/i18n-polyfill' @@ -16,6 +16,8 @@ export class MyAccountInterfaceSettingsComponent extends FormReactive implements @Input() user: User = null @Input() userInformationLoaded: Subject + private serverConfig: ServerConfig + constructor ( protected formValidatorService: FormValidatorService, private authService: AuthService, @@ -28,11 +30,15 @@ export class MyAccountInterfaceSettingsComponent extends FormReactive implements } get availableThemes () { - return this.serverService.getConfig().theme.registered + return this.serverConfig.theme.registered .map(t => t.name) } ngOnInit () { + this.serverConfig = this.serverService.getTmpConfig() + this.serverService.getConfig() + .subscribe(config => this.serverConfig = config) + this.buildForm({ theme: null }) -- cgit v1.2.3