don't stop loading until all the data is properly fetched
Fixes: https://tracker.ceph.com/issues/64170
Signed-off-by: Nizamudeen A <nia@redhat.com>
// this method was triggered by ngOnChanges().
if (this.fetchData.observers.length > 0) {
this.loadingIndicator = true;
- const loadingSubscription = this.fetchData.subscribe(() => {
- this.loadingIndicator = false;
- this.cdRef.detectChanges();
+ const loadingSubscription = this.fetchData.subscribe({
+ next: () => this.cdRef.detectChanges(),
+ complete: () => (this.loadingIndicator = false)
});
this._subscriptions.add(loadingSubscription);
}