aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+signup/+register/register-step-channel.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-29 14:39:49 +0200
committerChocobozzz <me@florianbigard.com>2019-05-29 14:39:49 +0200
commitb247a132709eb212fef4f77c4912dc0ec108f36b (patch)
treeb2700e6ed55e00cd213c44e8afdeea4c327ae904 /client/src/app/+signup/+register/register-step-channel.component.ts
parent1d5342abc43df02cf0bd69b1e865c0f179182eef (diff)
downloadPeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.tar.gz
PeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.tar.zst
PeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.zip
Add success icon on registration
Diffstat (limited to 'client/src/app/+signup/+register/register-step-channel.component.ts')
-rw-r--r--client/src/app/+signup/+register/register-step-channel.component.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts
new file mode 100644
index 000000000..9e13f75b3
--- /dev/null
+++ b/client/src/app/+signup/+register/register-step-channel.component.ts
@@ -0,0 +1,40 @@
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { AuthService } from '@app/core'
3import { FormReactive, VideoChannelValidatorsService } from '@app/shared'
4import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
5import { FormGroup } from '@angular/forms'
6
7@Component({
8 selector: 'my-register-step-channel',
9 templateUrl: './register-step-channel.component.html',
10 styleUrls: [ './register.component.scss' ]
11})
12export class RegisterStepChannelComponent extends FormReactive implements OnInit {
13 @Input() username: string
14 @Output() formBuilt = new EventEmitter<FormGroup>()
15
16 constructor (
17 protected formValidatorService: FormValidatorService,
18 private authService: AuthService,
19 private videoChannelValidatorsService: VideoChannelValidatorsService
20 ) {
21 super()
22 }
23
24 get instanceHost () {
25 return window.location.host
26 }
27
28 isSameThanUsername () {
29 return this.username && this.username === this.form.value['name']
30 }
31
32 ngOnInit () {
33 this.buildForm({
34 name: this.videoChannelValidatorsService.VIDEO_CHANNEL_NAME,
35 displayName: this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME
36 })
37
38 setTimeout(() => this.formBuilt.emit(this.form))
39 }
40}