Fix race condition
This commit is contained in:
parent
f8a0de9599
commit
c62206c6b0
1 changed files with 11 additions and 0 deletions
|
|
@ -153,6 +153,7 @@ export default {
|
|||
dropdownVariants,
|
||||
renderServiceZip: true,
|
||||
errorMessage: '',
|
||||
openingModal: false,
|
||||
SERVICE_ZIP_QUESTION_REF_NAME
|
||||
};
|
||||
},
|
||||
|
|
@ -234,6 +235,9 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
async internalZipcode() {
|
||||
if(this.openingModal) {
|
||||
return;
|
||||
}
|
||||
const shopsUpdated = await this.updateShops();
|
||||
if (shopsUpdated) {
|
||||
await this.$nextTick();
|
||||
|
|
@ -241,6 +245,9 @@ export default {
|
|||
}
|
||||
},
|
||||
async searchRadiusInMiles() {
|
||||
if(this.openingModal) {
|
||||
return;
|
||||
}
|
||||
await this.updateShops();
|
||||
}
|
||||
},
|
||||
|
|
@ -274,12 +281,16 @@ export default {
|
|||
this.$refs[this.modalName].closeModal();
|
||||
},
|
||||
onModalOpened() {
|
||||
this.openingModal = true;
|
||||
this.internalZipcode = this.serviceZipcode;
|
||||
this.searchRadiusInMiles = "25";
|
||||
this.nearbyShops = [];
|
||||
this.updateShops(true).then(() => {
|
||||
this.internalProviderNumber = this.nearbyShops[0]?.providerNumber;
|
||||
});
|
||||
this.$nextTick().then(() => {
|
||||
this.openingModal = false;
|
||||
});
|
||||
this.forceServiceZipRerender();
|
||||
},
|
||||
async updateSelectedProvider() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue