View updates

This commit is contained in:
2022-12-10 18:15:24 +01:00
parent ad0bc8a945
commit 1a27bedc95
7 changed files with 15 additions and 17 deletions

View File

@@ -14,7 +14,7 @@ export class LoaderInterceptor implements HttpInterceptor {
private tasks: number = 0;
constructor(
private _data: DataService
private data$: DataService
) { }
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
@@ -29,14 +29,14 @@ export class LoaderInterceptor implements HttpInterceptor {
addTask() {
this.tasks++;
if (this.tasks === 1) {
this._data.showLoader.next(true);
this.data$.showLoader.next(true);
}
}
removeTask() {
this.tasks--;
if (this.tasks === 0) {
this._data.showLoader.next(false);
this.data$.showLoader.next(false);
}
}
}