mirror of https://github.com/Chocobozzz/PeerTube
Reinstate routerLink property of upload button
parent
f24c8b142d
commit
333952bc64
|
@ -4,7 +4,7 @@
|
||||||
>
|
>
|
||||||
<span (click)="doSearch()" class="icon icon-search"></span>
|
<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>
|
<my-global-icon iconName="upload"></my-global-icon>
|
||||||
<span i18n class="upload-button-label">Upload</span>
|
<span i18n class="upload-button-label">Upload</span>
|
||||||
</a>
|
</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 () {
|
doSearch () {
|
||||||
const queryParams: Params = {}
|
const queryParams: Params = {}
|
||||||
|
|
||||||
|
@ -67,16 +77,6 @@ export class HeaderComponent implements OnInit {
|
||||||
this.serverConfig.signup.allowedForCurrentIP
|
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) {
|
private loadUserLanguagesIfNeeded (queryParams: any) {
|
||||||
if (queryParams && queryParams.languageOneOf) return of(queryParams)
|
if (queryParams && queryParams.languageOneOf) return of(queryParams)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue