File tree Expand file tree Collapse file tree 4 files changed +38
-12
lines changed Expand file tree Collapse file tree 4 files changed +38
-12
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,13 @@ <h3 class="text--neutral-white">Get starter $DESO</h3>
45
45
(error) ="onCaptchaError($event) "
46
46
>
47
47
</ ng-hcaptcha >
48
+ < div
49
+ *ngIf ="captchaFlowSpinner "
50
+ class ="padding-top--medium display--flex flex--column items--center "
51
+ >
52
+ < div > Waiting for your $DESO to arrive.</ div >
53
+ < div class ="spinner-border " style ="width: 6rem; height: 6rem "> </ div >
54
+ </ div >
48
55
< div *ngIf ="captchaFailed " class ="warning--error margin-top--small ">
49
56
There was an issue verifying your captcha. Please
50
57
< a (click) ="resetCaptcha() "> reset the captcha</ a > and try again, or
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ export class GetDesoComponent implements OnInit {
48
48
captchaFailed = false ;
49
49
// Whether the backend is offering rewards for solving captchas.
50
50
captchaAvailable = true ;
51
+ // Loader shown while waiting for DESO to arrive.
52
+ captchaFlowSpinner = false ;
51
53
52
54
publicKeyCopied = false ;
53
55
@@ -160,19 +162,26 @@ export class GetDesoComponent implements OnInit {
160
162
}
161
163
162
164
onCaptchaVerify ( token : string ) : void {
163
- this . backendAPIService . VerifyHCaptcha ( token , this . publicKeyAdded ) . subscribe (
164
- ( res ) => {
165
- if ( res . Success ) {
166
- this . isFinishFlowDisabled = false ;
167
- this . finishFlow ( ) ;
168
- } else {
165
+ this . captchaFlowSpinner = true ;
166
+ this . backendAPIService
167
+ . VerifyHCaptcha ( token , this . publicKeyAdded )
168
+ . subscribe (
169
+ async ( res ) => {
170
+ if ( res . Success ) {
171
+ await this . backendAPIService
172
+ . GetTxn ( res . TxnHashHex , 'InMempool' )
173
+ . toPromise ( ) ;
174
+ this . isFinishFlowDisabled = false ;
175
+ this . finishFlow ( ) ;
176
+ } else {
177
+ this . captchaFailed = true ;
178
+ }
179
+ } ,
180
+ ( err ) => {
169
181
this . captchaFailed = true ;
170
182
}
171
- } ,
172
- ( err ) => {
173
- this . captchaFailed = true ;
174
- }
175
- ) ;
183
+ )
184
+ . add ( ( ) => ( this . captchaFlowSpinner = false ) ) ;
176
185
}
177
186
178
187
onCaptchaExpired ( event : any ) : void {
Original file line number Diff line number Diff line change @@ -285,13 +285,21 @@ <h3 class="text--neutral-white">Confirm your authentication code</h3>
285
285
</ div >
286
286
</ div >
287
287
< div class ="margin-top--medium ">
288
+ < div
289
+ *ngIf ="submittingPhoneNumberVerificationCode "
290
+ class ="padding-top--medium display--flex flex--column items--center "
291
+ >
292
+ < div > Waiting for your $DESO to arrive.</ div >
293
+ < div class ="spinner-border " style ="width: 6rem; height: 6rem "> </ div >
294
+ </ div >
288
295
< button
289
296
data-control-name ="get-starter-deso-confirm-code-button "
290
297
(click) ="submitVerificationCode() "
291
298
[ngClass] ="{
292
299
disabled: !verificationCodeForm.valid,
293
300
'btn-loading': submittingPhoneNumberVerificationCode
294
301
} "
302
+ [disabled] ="submittingPhoneNumberVerificationCode "
295
303
class ="button--primary button--medium margin-bottom--medium "
296
304
>
297
305
Confirm
@@ -300,6 +308,7 @@ <h3 class="text--neutral-white">Confirm your authentication code</h3>
300
308
data-control-name ="get-starter-deso-back-button "
301
309
*ngIf ="displayForSignupFlow "
302
310
(click) ="backButtonClickedOnSubmitVerificationScreen() "
311
+ [disabled] ="submittingPhoneNumberVerificationCode "
303
312
class ="button--primary--outline button--medium "
304
313
>
305
314
Back
Original file line number Diff line number Diff line change @@ -300,7 +300,8 @@ export class SignUpGetStarterDESOComponent implements OnInit {
300
300
this . verificationCodeForm . value . verificationCode
301
301
)
302
302
. subscribe (
303
- ( res ) => {
303
+ async ( res ) => {
304
+ await this . backendApi . GetTxn ( res . TxnHashHex , 'InMempool' ) . toPromise ( ) ;
304
305
this . screenToShow =
305
306
SignUpGetStarterDESOComponent . COMPLETED_PHONE_NUMBER_VERIFICATION_SCREEN ;
306
307
this . phoneNumberVerified . emit ( ) ;
You can’t perform that action at this time.
0 commit comments