Reinstate routerLink property of upload button
This commit is contained in:
parent
f24c8b142d
commit
333952bc64
2 changed files with 11 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
|||
>
|
||||
<span (click)="doSearch()" class="icon icon-search"></span>
|
||||
|
||||
<a class="upload-button" (click)="goToUpload()">
|
||||
<a class="upload-button" [routerLink]="routerLink">
|
||||
<my-global-icon iconName="upload"></my-global-icon>
|
||||
<span i18n class="upload-button-label">Upload</span>
|
||||
</a>
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue