]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/menu/menu.component.ts
Add i18n attributes
[github/Chocobozzz/PeerTube.git] / client / src / app / menu / menu.component.ts
index 8b8b714a807139a9619429eaef445d8d382023fb..c0aea89b33d9bc2d408858ce4ff857eb04d4b324 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, OnInit } from '@angular/core'
 import { Router } from '@angular/router'
 import { UserRight } from '../../../../shared/models/users/user-right.enum'
-import { AuthService, AuthStatus, ServerService } from '../core'
+import { AuthService, AuthStatus, RedirectService, ServerService } from '../core'
 import { User } from '../shared/users/user.model'
 
 @Component({
@@ -24,7 +24,7 @@ export class MenuComponent implements OnInit {
   constructor (
     private authService: AuthService,
     private serverService: ServerService,
-    private router: Router
+    private redirectService: RedirectService
   ) {}
 
   ngOnInit () {
@@ -51,12 +51,9 @@ export class MenuComponent implements OnInit {
     )
   }
 
-  getUserAvatarPath () {
-    return this.user.getAvatarPath()
-  }
-
   isRegistrationAllowed () {
-    return this.serverService.getConfig().signup.allowed
+    return this.serverService.getConfig().signup.allowed &&
+           this.serverService.getConfig().signup.allowedForCurrentIP
   }
 
   getFirstAdminRightAvailable () {
@@ -90,7 +87,7 @@ export class MenuComponent implements OnInit {
 
     this.authService.logout()
     // Redirect to home page
-    this.router.navigate(['/videos/list'])
+    this.redirectService.redirectToHomepage()
   }
 
   private computeIsUserHasAdminAccess () {