1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-06 00:03:29 +00:00

Ensure icon component state is reset (#463)

This commit is contained in:
Oscar Hinton
2021-08-20 16:36:07 +02:00
committed by GitHub
parent 358260596b
commit fe3a387724

View File

@@ -42,6 +42,10 @@ export class IconComponent implements OnChanges {
}
async ngOnChanges() {
// Components may be re-used when using cdk-virtual-scroll. Which puts the component in a weird state,
// to avoid this we reset all state variables.
this.image = null;
this.fallbackImage = null;
this.imageEnabled = !(await this.stateService.get<boolean>(ConstantsService.disableFaviconKey));
this.load();
}