Browse Source

Merge pull request #15071 from mtsymbarov-del/fix/sync-toast-destroy-and-data-reset

Fixed a race condition causing the toast component
pull/15097/head
Vladyslav Prykhodko 3 months ago
committed by GitHub
parent
commit
edcaeb09b5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      ui-ngx/src/app/shared/components/toast.directive.ts

6
ui-ngx/src/app/shared/components/toast.directive.ts

@ -135,8 +135,10 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
notification: notificationMessage,
panelClass,
destroyToastComponent: () => {
this.viewContainerRef.detach(0);
this.toastComponentRef.destroy();
if (this.toastComponentRef) {
this.viewContainerRef.detach(0);
this.toastComponentRef.destroy();
}
}
};
const providers: StaticProvider[] = [

Loading…
Cancel
Save