Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Ensure icon component state is reset (#463)
Browse files Browse the repository at this point in the history
(cherry picked from commit fe3a387)
  • Loading branch information
Hinton committed Aug 20, 2021
1 parent 9177159 commit 61618d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions angular/src/components/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 61618d5

Please sign in to comment.