From 333952bc6478358ef6979b35d8dc215283b4717e Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 10 Jan 2020 15:52:25 +0100 Subject: [PATCH] Reinstate routerLink property of upload button --- client/src/app/header/header.component.html | 2 +- client/src/app/header/header.component.ts | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/src/app/header/header.component.html b/client/src/app/header/header.component.html index 4b3d5e105..599861817 100644 --- a/client/src/app/header/header.component.html +++ b/client/src/app/header/header.component.html @@ -4,7 +4,7 @@ > - + Upload diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 192d6945b..580535669 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts @@ -42,6 +42,16 @@ export class HeaderComponent implements OnInit { ) } + get routerLink () { + if (this.isUserLoggedIn()) { + return [ '/videos/upload' ] + } else if (this.isRegistrationAllowed()) { + return [ '/signup' ] + } else { + return [ '/login', { fromUpload: true } ] + } + } + doSearch () { const queryParams: Params = {} @@ -67,16 +77,6 @@ export class HeaderComponent implements OnInit { this.serverConfig.signup.allowedForCurrentIP } - goToUpload () { - if (this.isUserLoggedIn()) { - this.router.navigate([ '/videos/upload' ]) - } else if (this.isRegistrationAllowed()) { - this.router.navigate([ '/signup' ]) - } else { - this.router.navigate([ '/login', { fromUpload: true } ]) - } - } - private loadUserLanguagesIfNeeded (queryParams: any) { if (queryParams && queryParams.languageOneOf) return of(queryParams) -- 2.25.1