From 5a2e9a1ab1600a2f4592f45ae19f652669747b84 Mon Sep 17 00:00:00 2001 From: Dafnik Date: Tue, 21 Feb 2023 15:04:52 +0100 Subject: [PATCH] fix(dfx-helper): is mobile service migrate to shareReplace --- libs/dfx-helper/src/lib/services/is-mobile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/dfx-helper/src/lib/services/is-mobile.ts b/libs/dfx-helper/src/lib/services/is-mobile.ts index 6dc98921..955cdf0f 100755 --- a/libs/dfx-helper/src/lib/services/is-mobile.ts +++ b/libs/dfx-helper/src/lib/services/is-mobile.ts @@ -1,6 +1,6 @@ import {inject, Injectable, NgZone, OnDestroy} from '@angular/core'; import {ViewportRuler} from '@angular/cdk/overlay'; -import {BehaviorSubject, distinctUntilChanged, share} from 'rxjs'; +import {BehaviorSubject, distinctUntilChanged, shareReplay} from 'rxjs'; import {HELPER_MOBILE_BREAKPOINT} from '../config'; @Injectable({ @@ -18,7 +18,7 @@ export class IsMobileService implements OnDestroy { constructor(private ngZone: NgZone, private viewportRuler: ViewportRuler) {} - public isMobile$ = this.isMobileChange.pipe(distinctUntilChanged(), share()); + public isMobile$ = this.isMobileChange.pipe(distinctUntilChanged(), shareReplay(1)); public isMobile = this._isMobile;