Feedback processed: - change so state change behaviourSubjects back in NgZone.run

This commit is contained in:
Marie Verdonck
2020-06-19 13:59:21 +02:00
parent 94e3f2d5e0
commit 6433e211a8

View File

@@ -25,14 +25,13 @@ export class CommunityListDatasource implements DataSource<FlatNode> {
} }
loadCommunities(findOptions: FindListOptions, expandedNodes: FlatNode[]) { loadCommunities(findOptions: FindListOptions, expandedNodes: FlatNode[]) {
this.loading$.next(true);
this.zone.runOutsideAngular(() => { this.zone.runOutsideAngular(() => {
this.loading$.next(true);
this.communityListService.loadCommunities(findOptions, expandedNodes).pipe( this.communityListService.loadCommunities(findOptions, expandedNodes).pipe(
take(1), take(1),
finalize(() => this.loading$.next(false)), finalize(() => this.zone.run(() => this.loading$.next(false))),
).subscribe((flatNodes: FlatNode[]) => { ).subscribe((flatNodes: FlatNode[]) => {
this.communityList$.next(flatNodes); this.zone.run(() => this.communityList$.next(flatNodes));
}); });
}); });
} }