aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 0bfe9f916..494cd9ea6 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core'
2import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 2import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
3import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router' 3import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router'
4import { AuthService, RedirectService, ServerService } from '@app/core' 4import { AuthService, RedirectService, ServerService } from '@app/core'
5import { isInSmallView } from '@app/shared/misc/utils'
6import { is18nPath } from '../../../shared/models/i18n' 5import { is18nPath } from '../../../shared/models/i18n'
6import { ScreenService } from '@app/shared/misc/screen.service'
7 7
8@Component({ 8@Component({
9 selector: 'my-app', 9 selector: 'my-app',
@@ -33,7 +33,8 @@ export class AppComponent implements OnInit {
33 private authService: AuthService, 33 private authService: AuthService,
34 private serverService: ServerService, 34 private serverService: ServerService,
35 private domSanitizer: DomSanitizer, 35 private domSanitizer: DomSanitizer,
36 private redirectService: RedirectService 36 private redirectService: RedirectService,
37 private screenService: ScreenService
37 ) { } 38 ) { }
38 39
39 get serverVersion () { 40 get serverVersion () {
@@ -75,14 +76,14 @@ export class AppComponent implements OnInit {
75 this.serverService.loadVideoPrivacies() 76 this.serverService.loadVideoPrivacies()
76 77
77 // Do not display menu on small screens 78 // Do not display menu on small screens
78 if (isInSmallView()) { 79 if (this.screenService.isInSmallView()) {
79 this.isMenuDisplayed = false 80 this.isMenuDisplayed = false
80 } 81 }
81 82
82 this.router.events.subscribe( 83 this.router.events.subscribe(
83 e => { 84 e => {
84 // User clicked on a link in the menu, change the page 85 // User clicked on a link in the menu, change the page
85 if (e instanceof GuardsCheckStart && isInSmallView()) { 86 if (e instanceof GuardsCheckStart && this.screenService.isInSmallView()) {
86 this.isMenuDisplayed = false 87 this.isMenuDisplayed = false
87 } 88 }
88 } 89 }