case 4222

This commit is contained in:
2022-10-27 14:42:57 +00:00
parent 667be62eb3
commit efd51582ff
2 changed files with 14 additions and 2 deletions

View File

@@ -280,6 +280,7 @@ export default {
}, },
licenseState: 0, licenseState: 0,
dbIsEmpty: false, dbIsEmpty: false,
isRequesting: false,
request: { request: {
Email: null, Email: null,
Company: "", Company: "",
@@ -404,6 +405,9 @@ export default {
if (this.request.Company == null) { if (this.request.Company == null) {
return true; return true;
} }
if (this.isRequesting) {
return true;
}
return !this.form().controlsAreAllValid(this, [ return !this.form().controlsAreAllValid(this, [
"requestcompany", "requestcompany",
"requestcontact", "requestcontact",
@@ -434,6 +438,7 @@ export default {
} }
} }
this.isRequesting = true;
//call erase //call erase
window.$gz.erasingDatabase = true; //suspend notify polling window.$gz.erasingDatabase = true; //suspend notify polling
let r = await window.$gz.api.upsert( let r = await window.$gz.api.upsert(
@@ -462,6 +467,8 @@ export default {
//then another message box saying watch your email to verify //then another message box saying watch your email to verify
} catch (error) { } catch (error) {
window.$gz.errorHandler.handleFormError(error, vm); window.$gz.errorHandler.handleFormError(error, vm);
} finally {
this.isRequesting = false;
} }
}, },
async fetchKey() { async fetchKey() {

View File

@@ -63,6 +63,7 @@
> >
<v-btn <v-btn
:loading="seedingJobActive" :loading="seedingJobActive"
:disabled="!generateStartJobAvailable"
color="blue darken-1" color="blue darken-1"
text text
data-cy="btnStart" data-cy="btnStart"
@@ -134,6 +135,7 @@ export default {
seedLevels: [] seedLevels: []
}, },
seedingJobActive: false, seedingJobActive: false,
generateStartJobAvailable: false,
obj: { obj: {
seedLevel: "small", seedLevel: "small",
timeZoneOffset: 0, timeZoneOffset: 0,
@@ -203,6 +205,7 @@ export default {
); );
return; return;
} }
this.generateStartJobAvailable = true;
this.seedDialog = !this.seedDialog; this.seedDialog = !this.seedDialog;
}, },
async generate() { async generate() {
@@ -224,7 +227,9 @@ export default {
if (dialogResult == false) { if (dialogResult == false) {
return; return;
} }
//point of no return, disable button so user can click again (was a huge bug)
vm.generateStartJobAvailable = false;
vm.seedingJobActive = true;
//call the FULL (including taxcodes) erase before seeding //call the FULL (including taxcodes) erase before seeding
window.$gz.erasingDatabase = true; //flags notify poll to suspend as user may be gone window.$gz.erasingDatabase = true; //flags notify poll to suspend as user may be gone
let r = await window.$gz.api.upsert( let r = await window.$gz.api.upsert(
@@ -243,7 +248,7 @@ export default {
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm)); throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
} }
jobId = jobId.jobId; jobId = jobId.jobId;
vm.seedingJobActive = true;
let jobStatus = 1; let jobStatus = 1;
while (vm.seedingJobActive == true) { while (vm.seedingJobActive == true) {
await window.$gz.util.sleepAsync(5000); await window.$gz.util.sleepAsync(5000);