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 7 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, notification: notificationMessage,
panelClass, panelClass,
destroyToastComponent: () => { destroyToastComponent: () => {
this.viewContainerRef.detach(0); if (this.toastComponentRef) {
this.toastComponentRef.destroy(); this.viewContainerRef.detach(0);
this.toastComponentRef.destroy();
}
} }
}; };
const providers: StaticProvider[] = [ const providers: StaticProvider[] = [

Loading…
Cancel
Save