[faucet] show unverified warning if no email provided
This commit is contained in:
		
							parent
							
								
									485a58e453
								
							
						
					
					
						commit
						a133ddf062
					
				| @ -27,6 +27,14 @@ | |||||||
|         <app-twitter-login customClass="btn btn-sm" width="220px" redirectTo="/testnet4/faucet" buttonString="Sign up with Twitter"></app-twitter-login> |         <app-twitter-login customClass="btn btn-sm" width="220px" redirectTo="/testnet4/faucet" buttonString="Sign up with Twitter"></app-twitter-login> | ||||||
|       </div> |       </div> | ||||||
|     } |     } | ||||||
|  |     @else if (user && user.status === 'pending' && !user.email && user.snsId) { | ||||||
|  |       <div class="alert alert-danger w-100 col d-flex justify-content-center text-left"> | ||||||
|  |         <span class="d-flex"> | ||||||
|  |           <fa-icon [icon]="['fas', 'exclamation-triangle']" [fixedWidth]="true" class="mr-1"></fa-icon> | ||||||
|  |           <span>Please <a class="text-primary" [routerLink]="['/services/account/settings']">verify your account</a> by providing a valid email address. To mitigate spam, we delete unverified accounts at regular intervals.</span> | ||||||
|  |         </span> | ||||||
|  |       </div> | ||||||
|  |     } | ||||||
|     @else if (error === 'not_available') { |     @else if (error === 'not_available') { | ||||||
|       <!-- User logged in but not a paid user or did not link its Twitter account --> |       <!-- User logged in but not a paid user or did not link its Twitter account --> | ||||||
|       <div class="alert alert-mempool d-block text-center w-100"> |       <div class="alert alert-mempool d-block text-center w-100"> | ||||||
|  | |||||||
| @ -1,7 +1,6 @@ | |||||||
| import { Component, OnDestroy, OnInit, ChangeDetectorRef } from "@angular/core"; | import { Component, OnDestroy, OnInit, ChangeDetectorRef } from "@angular/core"; | ||||||
| import { FormBuilder, FormGroup, Validators, ValidatorFn, AbstractControl, ValidationErrors } from "@angular/forms"; | import { FormBuilder, FormGroup, Validators, ValidatorFn, AbstractControl, ValidationErrors } from "@angular/forms"; | ||||||
| import { Subscription } from "rxjs"; | import { Subscription } from "rxjs"; | ||||||
| import { StorageService } from "../../services/storage.service"; |  | ||||||
| import { ServicesApiServices } from "../../services/services-api.service"; | import { ServicesApiServices } from "../../services/services-api.service"; | ||||||
| import { getRegex } from "../../shared/regex.utils"; | import { getRegex } from "../../shared/regex.utils"; | ||||||
| import { StateService } from "../../services/state.service"; | import { StateService } from "../../services/state.service"; | ||||||
| @ -34,7 +33,6 @@ export class FaucetComponent implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|   constructor( |   constructor( | ||||||
|     private cd: ChangeDetectorRef, |     private cd: ChangeDetectorRef, | ||||||
|     private storageService: StorageService, |  | ||||||
|     private servicesApiService: ServicesApiServices, |     private servicesApiService: ServicesApiServices, | ||||||
|     private formBuilder: FormBuilder, |     private formBuilder: FormBuilder, | ||||||
|     private stateService: StateService, |     private stateService: StateService, | ||||||
| @ -56,14 +54,17 @@ export class FaucetComponent implements OnInit, OnDestroy { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.user = this.storageService.getAuth()?.user ?? null; |     this.servicesApiService.userSubject$.subscribe(user => { | ||||||
|     if (!this.user) { |       this.user = user; | ||||||
|  |       if (!user) { | ||||||
|         this.loading = false; |         this.loading = false; | ||||||
|  |         this.cd.markForCheck(); | ||||||
|         return; |         return; | ||||||
|       } |       } | ||||||
| 
 |  | ||||||
|       // Setup form
 |       // Setup form
 | ||||||
|       this.updateFaucetStatus(); |       this.updateFaucetStatus(); | ||||||
|  |       this.cd.markForCheck(); | ||||||
|  |     }); | ||||||
| 
 | 
 | ||||||
|     // Track transaction
 |     // Track transaction
 | ||||||
|     this.websocketService.want(['blocks', 'mempool-blocks']); |     this.websocketService.want(['blocks', 'mempool-blocks']); | ||||||
| @ -145,9 +146,6 @@ export class FaucetComponent implements OnInit, OnDestroy { | |||||||
|       'address': ['', [Validators.required, Validators.pattern(getRegex('address', 'testnet4')), this.getNotFaucetAddressValidator(faucetAddress)]], |       'address': ['', [Validators.required, Validators.pattern(getRegex('address', 'testnet4')), this.getNotFaucetAddressValidator(faucetAddress)]], | ||||||
|       'satoshis': [min, [Validators.required, Validators.min(min), Validators.max(max)]] |       'satoshis': [min, [Validators.required, Validators.min(min), Validators.max(max)]] | ||||||
|     }); |     }); | ||||||
| 
 |  | ||||||
|     this.loading = false; |  | ||||||
|     this.cd.markForCheck(); |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   updateForm(min, max, faucetAddress: string): void { |   updateForm(min, max, faucetAddress: string): void { | ||||||
| @ -160,6 +158,8 @@ export class FaucetComponent implements OnInit, OnDestroy { | |||||||
|       this.faucetForm.get('satoshis').updateValueAndValidity(); |       this.faucetForm.get('satoshis').updateValueAndValidity(); | ||||||
|       this.faucetForm.get('satoshis').markAsDirty(); |       this.faucetForm.get('satoshis').markAsDirty(); | ||||||
|     } |     } | ||||||
|  |     this.loading = false; | ||||||
|  |     this.cd.markForCheck(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   setAmount(value: number): void { |   setAmount(value: number): void { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user