1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

icon load function

This commit is contained in:
Kyle Spearrin
2018-11-15 16:55:54 -05:00
parent da47faca5c
commit e13f317aad

View File

@@ -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<boolean>(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;