mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-08 19:18:02 +01:00
icon load function
This commit is contained in:
parent
da47faca5c
commit
e13f317aad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user