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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
2 deletions
-
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[] = [ |
|
|
|
|