diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-10 14:01:13 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-10 14:01:23 +0100 |
commit | 000eb0e40d74e914f6691305511c44e89cd8bf07 (patch) | |
tree | 8745c9f15041fc04b3f02dd087ecce330d3b9428 /client/src/app/login/login.component.ts | |
parent | ab4d4db44a4f943056b856cbdc7b8d157cabf9af (diff) | |
download | PeerTube-000eb0e40d74e914f6691305511c44e89cd8bf07.tar.gz PeerTube-000eb0e40d74e914f6691305511c44e89cd8bf07.tar.zst PeerTube-000eb0e40d74e914f6691305511c44e89cd8bf07.zip |
Add informational message at login for visitors coming from upload button
resolves #1880
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r-- | client/src/app/login/login.component.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index ffadc9aa4..1394d6b58 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { Notifier, RedirectService, ServerService } from '@app/core' | 2 | import { Notifier, RedirectService } from '@app/core' |
3 | import { UserService } from '@app/shared' | 3 | import { UserService } from '@app/shared' |
4 | import { AuthService } from '../core' | 4 | import { AuthService } from '../core' |
5 | import { FormReactive } from '../shared' | 5 | import { FormReactive } from '../shared' |
@@ -7,8 +7,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill' | |||
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
8 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' | 8 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' |
9 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | 9 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' |
10 | import { ActivatedRoute, Router } from '@angular/router' | 10 | import { ActivatedRoute } from '@angular/router' |
11 | import { ServerConfig } from '@shared/models' | 11 | import { ServerConfig } from '@shared/models/server/server-config.model' |
12 | 12 | ||
13 | @Component({ | 13 | @Component({ |
14 | selector: 'my-login', | 14 | selector: 'my-login', |
@@ -22,6 +22,9 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
22 | 22 | ||
23 | error: string = null | 23 | error: string = null |
24 | forgotPasswordEmail = '' | 24 | forgotPasswordEmail = '' |
25 | from = { | ||
26 | upload: false | ||
27 | } | ||
25 | 28 | ||
26 | private openedForgotPasswordModal: NgbModalRef | 29 | private openedForgotPasswordModal: NgbModalRef |
27 | private serverConfig: ServerConfig | 30 | private serverConfig: ServerConfig |
@@ -44,12 +47,17 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
44 | return this.serverConfig.signup.allowed === true | 47 | return this.serverConfig.signup.allowed === true |
45 | } | 48 | } |
46 | 49 | ||
50 | get instancesIndexUrl () { | ||
51 | return this.serverConfig.followings.instance.autoFollowIndex.indexUrl || 'https://instances.joinpeertube.org' | ||
52 | } | ||
53 | |||
47 | isEmailDisabled () { | 54 | isEmailDisabled () { |
48 | return this.serverConfig.email.enabled === false | 55 | return this.serverConfig.email.enabled === false |
49 | } | 56 | } |
50 | 57 | ||
51 | ngOnInit () { | 58 | ngOnInit () { |
52 | this.serverConfig = this.route.snapshot.data.serverConfig | 59 | this.serverConfig = this.route.snapshot.data.serverConfig |
60 | this.from.upload = Boolean(this.route.snapshot.paramMap.get('fromUpload')) | ||
53 | 61 | ||
54 | this.buildForm({ | 62 | this.buildForm({ |
55 | username: this.loginValidatorsService.LOGIN_USERNAME, | 63 | username: this.loginValidatorsService.LOGIN_USERNAME, |