Moved resetting of # of shops to be displayed

This commit is contained in:
Scott Kiener 2025-07-16 15:06:23 -04:00
parent c0a93abfbf
commit 59cf55a7fd

View file

@ -181,6 +181,7 @@ export default {
this.updateShopsForZip(this.localZipCode);
this.$refs.shopQuestionModal.openModal();
},
updateShopListWithNextShops(numberToGet = 3) {
//gaAction = this.GaActions.SHOPS_FIRST_DISPLAYED; --This needs to actually fire on initial display, can never happen here
@ -272,6 +273,7 @@ export default {
getShopProviderData(this.localZipCode).then(async (result) => {
this.displayNoShopsAlert = false;
this.localShopProviderData = result.data;
this.indexOfLastShopToBeDisplayed = 3;
this.updateShopsForZip(this.localZipCode);
});
}
@ -289,15 +291,6 @@ export default {
return;
}
const selectedIndex = this.shopProviders.findIndex(
(provider) => provider.providerNumber == this.localSelectedProviderNumber
);
// If not found, only show the first 3 shops
if (selectedIndex === -1) {
this.indexOfLastShopToBeDisplayed = 3;
}
const sortedShops = this.getShopsByZip(zipCode, this.shopProviders, this.indexOfLastShopToBeDisplayed);
const toTitleCase = (str) => {