Skip to content

Commit

Permalink
fix(theme:_HttpClient): fix count when subscribed (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Feb 3, 2021
1 parent 26d41e1 commit a6b375a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/theme/src/services/http/http.client.ts
Expand Up @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
import { AlainConfigService, AlainThemeHttpClientConfig } from '@delon/util/config';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { Observable, of } from 'rxjs';
import { finalize, switchMap } from 'rxjs/operators';
import { finalize, switchMap, tap } from 'rxjs/operators';

export type _HttpHeaders = HttpHeaders | { [header: string]: string | string[] };
export type HttpObserve = 'body' | 'events' | 'response';
Expand Down Expand Up @@ -981,9 +981,9 @@ export class _HttpClient {
withCredentials?: boolean;
} = {},
): Observable<any> {
this.push();
if (options.params) options.params = this.parseParams(options.params);
return of(null).pipe(
tap(() => this.push()),
switchMap(() => this.http.request(method, url, options)),
finalize(() => this.pop()),
);
Expand Down

0 comments on commit a6b375a

Please sign in to comment.