- private configService: ConfigService,
- private userService: UserService,
- private videoService: VideoService,
- viewContainerRef: ViewContainerRef
- ) {}
-
- ngOnInit() {
- if (this.authService.isLoggedIn()) {
+ private serverService: ServerService,
+ private domSanitizer: DomSanitizer,
+ private redirectService: RedirectService,
+ private screenService: ScreenService
+ ) { }
+
+ get serverVersion () {
+ return this.serverService.getConfig().serverVersion
+ }
+
+ get instanceName () {
+ return this.serverService.getConfig().instance.name
+ }
+
+ get defaultRoute () {
+ return RedirectService.DEFAULT_ROUTE
+ }
+
+ ngOnInit () {
+ document.getElementById('incompatible-browser').className += ' browser-ok'
+
+ this.router.events.subscribe(e => {
+ if (e instanceof NavigationEnd) {
+ const pathname = window.location.pathname
+ if (!pathname || pathname === '/' || is18nPath(pathname)) {
+ this.redirectService.redirectToHomepage(true)
+ }
+ }
+ })
+
+ this.authService.loadClientCredentials()
+
+ if (this.isUserLoggedIn()) {