diff --git a/projects/common/src/fm/components/app/app.component.ts b/projects/common/src/fm/components/app/app.component.ts index b315b7b..f26e3cd 100644 --- a/projects/common/src/fm/components/app/app.component.ts +++ b/projects/common/src/fm/components/app/app.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, OnDestroy, Inject, ViewEncapsulation, RendererFactory2, PLATFORM_ID, ChangeDetectionStrategy, HostListener } from '@angular/core'; -import { Router, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, ActivatedRoute, PRIMARY_OUTLET } from '@angular/router'; +import { Router, NavigationStart, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, ActivatedRoute, PRIMARY_OUTLET } from '@angular/router'; import { Meta, Title, MetaDefinition } from '@angular/platform-browser';import { DOCUMENT } from "@angular/common"; import { Subscription , Observable } from 'rxjs'; import { Store, Action } from '@ngrx/store'; @@ -117,6 +117,9 @@ export class AppComponent implements OnInit, OnDestroy { if (event instanceof RouteConfigLoadEnd) { other.store.dispatch(new commonActions.EndRouteLoading()); } + if(event instanceof NavigationStart) { + other.store.dispatch(new commonActions.SetMenuVisible(false)); + } }); } diff --git a/projects/common/src/fm/effects/app-common.effects.ts b/projects/common/src/fm/effects/app-common.effects.ts index 63c2350..cc974dd 100644 --- a/projects/common/src/fm/effects/app-common.effects.ts +++ b/projects/common/src/fm/effects/app-common.effects.ts @@ -101,14 +101,7 @@ export class AppCommonEffects { } )); - @Effect() - closeMenuOnRouting$:Observable = this.actions$.pipe( - ofType(appCommonActions.STARTROUTELOADING), - switchMap((action) => { - return of(new appCommonActions.SetMenuVisible(false)); - } - )); - + @Effect({ dispatch: false }) fail$: Observable = this.actions$.pipe( ofType(appCommonActions.FAIL),