Skip to content

Commit

Permalink
fix(dfx-helper): is mobile service migrate to shareReplace
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Feb 21, 2023
1 parent 3844ac1 commit 5a2e9a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/dfx-helper/src/lib/services/is-mobile.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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;

Expand Down

0 comments on commit 5a2e9a1

Please sign in to comment.