Browse Source

fixed loading indicator on signup button

Signed-off-by: Ido David <idonkl100@gmail.com>
pull/257/head
Ido David 3 years ago
parent
commit
12d10de2e7
  1. 19
      packages/nc-gui/pages/user/authentication/signup/index.vue

19
packages/nc-gui/pages/user/authentication/signup/index.vue

@ -71,18 +71,9 @@
<!-- </vue-recaptcha>--> <!-- </vue-recaptcha>-->
<v-btn @click="MtdOnSignup" color="primary" class="btn--large" <v-btn @click="MtdOnSignup" color="primary" class="btn--large" :loading="signUpButtonLoading"
:disabled="!formUtil.recpatcha || !formUtil.valid" v-ge="['Sign Up ','']"> :disabled="!formUtil.recpatcha || !formUtil.valid" v-ge="['Sign Up ','']">
&nbsp; Sign Up &nbsp; &nbsp; Sign Up &nbsp;
<v-progress-circular
class="pb-3 pt-0 mt-0"
:value="formUtil.passwordProgress"
width="2"
size="18"
small
color="success">
</v-progress-circular>
</v-btn> </v-btn>
@ -261,6 +252,8 @@ export default {
googleAuthUrl: "/api/auth/google", googleAuthUrl: "/api/auth/google",
facebookAuthUrl: "/api/auth/facebook", facebookAuthUrl: "/api/auth/facebook",
signUpButtonLoading: false
} }
}, },
methods: { methods: {
@ -347,6 +340,9 @@ export default {
async MtdOnSignup(e) { async MtdOnSignup(e) {
e.preventDefault(); e.preventDefault();
this.signUpButtonLoading = true;
if (this.type === 'jwt') { if (this.type === 'jwt') {
if (this.$refs.formType.validate()) { if (this.$refs.formType.validate()) {
//this.$nuxt.$loading.start() //this.$nuxt.$loading.start()
@ -368,6 +364,7 @@ export default {
this.formUtil.formErr = true; this.formUtil.formErr = true;
this.formUtil.formErrMsg = err.data.msg; this.formUtil.formErrMsg = err.data.msg;
console.log(err.data.msg); console.log(err.data.msg);
this.signUpButtonLoading = false;
return return
} }
@ -379,6 +376,7 @@ export default {
if (!valid) { if (!valid) {
this.formUtil.formErr = true; this.formUtil.formErr = true;
this.formUtil.formErrMsg = 'Invalid admin secret'; this.formUtil.formErrMsg = 'Invalid admin secret';
this.signUpButtonLoading = false;
return return
} }
this.$store.commit('users/MutMasterKey', this.form.secret); this.$store.commit('users/MutMasterKey', this.form.secret);
@ -390,6 +388,7 @@ export default {
} else { } else {
this.$router.push('/projects?toast'); this.$router.push('/projects?toast');
} }
this.signUpButtonLoading = false;
}, },

Loading…
Cancel
Save