import { Component, OnInit } from '@angular/core'
-import { NavigationEnd, Router } from '@angular/router'
+import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router'
import { AuthService, ServerService } from '@app/core'
+import { isInSmallView } from '@app/shared/misc/utils'
@Component({
selector: 'my-app',
return this.serverService.getConfig().serverVersion
}
+ get instanceName () {
+ return this.serverService.getConfig().instance.name
+ }
+
ngOnInit () {
this.authService.loadClientCredentials()
this.serverService.loadVideoPrivacies()
// Do not display menu on small screens
- if (window.innerWidth < 600) {
+ if (isInSmallView()) {
this.isMenuDisplayed = false
}
this.router.events.subscribe(
e => {
// User clicked on a link in the menu, change the page
- if (e instanceof NavigationEnd && window.innerWidth < 600) {
+ if (e instanceof GuardsCheckStart && isInSmallView()) {
this.isMenuDisplayed = false
}
}