diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.html b/src/app/header-nav-wrapper/header-navbar-wrapper.component.html index 5756ad32b0b..47e31ea7330 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.html +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts index 9786f0ed1d0..0a32b3a70ea 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -1,8 +1,5 @@ -import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core'; -import { Store } from '@ngrx/store'; -import { AppState } from '../app.reducer'; -import { hasValue } from '../shared/empty.util'; -import { Observable, Subscription } from 'rxjs'; +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; import { HostWindowService, WidthCategory } from '../shared/host-window.service'; @@ -15,17 +12,14 @@ import { HostWindowService, WidthCategory } from '../shared/host-window.service' styleUrls: ['header-navbar-wrapper.component.scss'], templateUrl: 'header-navbar-wrapper.component.html', }) -export class HeaderNavbarWrapperComponent implements OnInit, OnDestroy { - @HostBinding('class.open') isOpen = false; - private sub: Subscription; - public isNavBarCollapsed: Observable; +export class HeaderNavbarWrapperComponent implements OnInit { + public isNavBarCollapsed$: Observable; public isMobile$: Observable; menuID = MenuID.PUBLIC; maxMobileWidth = WidthCategory.SM; constructor( - private store: Store, private menuService: MenuService, protected windowService: HostWindowService, ) { @@ -33,13 +27,7 @@ export class HeaderNavbarWrapperComponent implements OnInit, OnDestroy { ngOnInit(): void { this.isMobile$ = this.windowService.isUpTo(this.maxMobileWidth); - this.isNavBarCollapsed = this.menuService.isMenuCollapsed(this.menuID); - this.sub = this.isNavBarCollapsed.subscribe((isCollapsed) => this.isOpen = !isCollapsed); + this.isNavBarCollapsed$ = this.menuService.isMenuCollapsed(this.menuID); } - ngOnDestroy() { - if (hasValue(this.sub)) { - this.sub.unsubscribe(); - } - } }