From: Rigel Kent Date: Fri, 10 Jan 2020 14:52:25 +0000 (+0100) Subject: Reinstate routerLink property of upload button X-Git-Tag: v2.1.0-rc.1~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=333952bc6478358ef6979b35d8dc215283b4717e;p=oweals%2Fpeertube.git Reinstate routerLink property of upload button --- 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)