From a114f711ec06a80d4129722b609d75f648d311bc Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 4 May 2020 17:15:08 +0300 Subject: [PATCH] fix: add zero delay timeout before change detection call --- .../src/lib/services/confirmation.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts b/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts index 4c69d0cc37..2672a93a2a 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts @@ -1,9 +1,9 @@ -import { Injectable, ComponentRef } from '@angular/core'; -import { Confirmation } from '../models/confirmation'; -import { fromEvent, Observable, Subject, ReplaySubject } from 'rxjs'; -import { takeUntil, debounceTime, filter } from 'rxjs/operators'; import { Config, ContentProjectionService, PROJECTION_STRATEGY } from '@abp/ng.core'; +import { ComponentRef, Injectable } from '@angular/core'; +import { fromEvent, Observable, ReplaySubject, Subject } from 'rxjs'; +import { debounceTime, filter, takeUntil } from 'rxjs/operators'; import { ConfirmationComponent } from '../components/confirmation/confirmation.component'; +import { Confirmation } from '../models/confirmation'; @Injectable({ providedIn: 'root' }) export class ConfirmationService { @@ -27,7 +27,9 @@ export class ConfirmationService { }), ); - this.containerComponentRef.changeDetectorRef.detectChanges(); + setTimeout(() => { + this.containerComponentRef.changeDetectorRef.detectChanges(); + }, 0); } info(