diff --git a/web/satellite/src/views/RegisterArea.vue b/web/satellite/src/views/RegisterArea.vue index a35f8f128..8b3628f2f 100644 --- a/web/satellite/src/views/RegisterArea.vue +++ b/web/satellite/src/views/RegisterArea.vue @@ -200,10 +200,11 @@

reCAPTCHA is required

- { - if (this.isLoading) { + if (this.$refs.recaptcha && !this.recaptchaResponseToken) { + this.$refs.recaptcha.execute(); return; } - this.isLoading = true; - - if (!this.validateFields()) { - this.isLoading = false; - - return; - } await this.createUser(); - - this.isLoading = false; } /** @@ -501,6 +498,7 @@ export default class RegisterArea extends Vue { public onRecaptchaVerified(response: string): void { this.recaptchaResponseToken = response; this.recaptchaError = false; + this.createUser(); } /** @@ -508,6 +506,7 @@ export default class RegisterArea extends Vue { */ public onRecaptchaError(): void { this.recaptchaResponseToken = ''; + this.recaptchaError = true; } /** @@ -566,11 +565,6 @@ export default class RegisterArea extends Vue { isNoErrors = false; } - if (this.recaptchaEnabled && !this.recaptchaResponseToken) { - this.recaptchaError = true; - isNoErrors = false; - } - return isNoErrors; } @@ -578,6 +572,16 @@ export default class RegisterArea extends Vue { * Creates user and toggles successful registration area visibility. */ private async createUser(): Promise { + if (this.isLoading) { + return; + } + + if (!this.validateFields()) { + return; + } + + this.isLoading = true; + this.user.isProfessional = this.isProfessional; this.user.haveSalesContact = this.haveSalesContact; @@ -588,11 +592,11 @@ export default class RegisterArea extends Vue { await this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_SUCCESSFUL_REGISTRATION); } catch (error) { if (this.$refs.recaptcha) { - (this.$refs.recaptcha as VueRecaptcha).reset(); + this.$refs.recaptcha.reset(); } await this.$notify.error(error.message); - this.isLoading = false; } + this.isLoading = false; } } @@ -1204,6 +1208,10 @@ export default class RegisterArea extends Vue { } } + ::v-deep .grecaptcha-badge { + z-index: 99; + } + @media screen and (max-width: 414px) { .register-area {