From fe3a387724ecf49bfc947a9c65f933cb4667df9d Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 20 Aug 2021 16:36:07 +0200 Subject: [PATCH] Ensure icon component state is reset (#463) --- angular/src/components/icon.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/angular/src/components/icon.component.ts b/angular/src/components/icon.component.ts index 6c82f9c278b..7d4126c081b 100644 --- a/angular/src/components/icon.component.ts +++ b/angular/src/components/icon.component.ts @@ -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(ConstantsService.disableFaviconKey)); this.load(); }