1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,10 @@ export class IconComponent implements OnChanges {
} }
async ngOnChanges() { 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.imageEnabled = !(await this.stateService.get<boolean>(ConstantsService.disableFaviconKey));
this.load(); this.load();
} }