@smartsoft001/angular 1.2.34 → 1.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
24
24
  import { App, Plugins, CameraResultType } from '@capacitor/core';
25
25
  import { __decorate, __metadata } from 'tslib';
26
26
  import { Memoize } from 'lodash-decorators';
27
- import { of, Subject, BehaviorSubject, Subscription, isObservable } from 'rxjs';
27
+ import { of, Subject, BehaviorSubject, Subscription, combineLatest, isObservable } from 'rxjs';
28
28
  import { TableVirtualScrollDataSource } from 'ng-table-virtual-scroll';
29
29
  import * as i1$2 from '@angular/platform-browser';
30
30
  import * as i2$2 from '@angular/router';
@@ -2547,7 +2547,9 @@ class MenuService {
2547
2547
  this.resolver = resolver;
2548
2548
  this._openedEnd = false;
2549
2549
  this._menuItemsSource = new BehaviorSubject([]);
2550
+ this._disableSource = new BehaviorSubject(false);
2550
2551
  this.menuItems$ = this._menuItemsSource.asObservable();
2552
+ this.disable$ = this._disableSource.asObservable();
2551
2553
  }
2552
2554
  /**
2553
2555
  * @desc checking if the menu is open (menu on the right side of the screen)
@@ -2555,6 +2557,12 @@ class MenuService {
2555
2557
  get openedEnd() {
2556
2558
  return this._openedEnd;
2557
2559
  }
2560
+ enable() {
2561
+ this._disableSource.next(false);
2562
+ }
2563
+ disable() {
2564
+ this._disableSource.next(true);
2565
+ }
2558
2566
  changeMenuItemByRoute(route, changes) {
2559
2567
  const items = this._menuItemsSource.value.map(i => {
2560
2568
  if (i.route === route)
@@ -2663,9 +2671,12 @@ class AppBaseComponent {
2663
2671
  this._subscriptions.unsubscribe();
2664
2672
  }
2665
2673
  initMenu() {
2666
- this.showMenu$ = this._options.provider.logged$.pipe(map((logged) => {
2667
- return (logged || (this._options.menu && this._options.menu.showForAnonymous));
2668
- }));
2674
+ this.showMenu$ =
2675
+ combineLatest(this._options.provider.logged$, this.menuService.disable$).pipe(map(([logged, disable]) => {
2676
+ if (disable)
2677
+ return false;
2678
+ return (logged || (this._options.menu && this._options.menu.showForAnonymous));
2679
+ }));
2669
2680
  if (this._options.menu) {
2670
2681
  this.menuService.setMenuItems(this._options.menu.items);
2671
2682
  this.menuItems$ = this.menuService.menuItems$;