diff --git a/src/angular/components/icon.component.ts b/src/angular/components/icon.component.ts index be525b926d..21008256fe 100644 --- a/src/angular/components/icon.component.ts +++ b/src/angular/components/icon.component.ts @@ -37,7 +37,7 @@ export class IconComponent implements OnChanges { private iconsUrl: string; - constructor(private environmentService: EnvironmentService, private stateService: StateService) { + constructor(environmentService: EnvironmentService, protected stateService: StateService) { this.iconsUrl = environmentService.iconsUrl; if (!this.iconsUrl) { if (environmentService.baseUrl) { @@ -49,8 +49,16 @@ export class IconComponent implements OnChanges { } async ngOnChanges() { + console.log('load it changes'); this.imageEnabled = !(await this.stateService.get(ConstantsService.disableFaviconKey)); + this.load(); + } + get iconCode(): string { + return IconMap[this.icon]; + } + + protected load() { switch (this.cipher.type) { case CipherType.Login: this.icon = 'fa-globe'; @@ -70,10 +78,6 @@ export class IconComponent implements OnChanges { } } - get iconCode(): string { - return IconMap[this.icon]; - } - private setLoginIcon() { if (this.cipher.login.uri) { let hostnameUri = this.cipher.login.uri;