Merge pull request #1518 from Safelite/feature/skiener/CSR-1452
CSR-1452 | Loading modal spinner for revalidate (payment-method)
This commit is contained in:
commit
3fec7ad060
2 changed files with 15 additions and 11 deletions
|
|
@ -54,6 +54,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const windowPageShowCallback = function (evt) {
|
||||||
|
if (evt.persisted) {
|
||||||
|
setTimeout(function () {
|
||||||
|
window.location.reload();
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Modal",
|
name: "Modal",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -93,17 +101,11 @@ export default {
|
||||||
this.isModalTextCarouselVisible = showTextCarousel;
|
this.isModalTextCarouselVisible = showTextCarousel;
|
||||||
this.isModalVisible = true;
|
this.isModalVisible = true;
|
||||||
//Force page reload on back button
|
//Force page reload on back button
|
||||||
window.addEventListener(
|
window.addEventListener("pageshow", windowPageShowCallback, false);
|
||||||
"pageshow",
|
},
|
||||||
function (evt) {
|
hideModal() {
|
||||||
if (evt.persisted) {
|
this.isModalVisible = false;
|
||||||
setTimeout(function () {
|
window.removeEventListener("pageshow", windowPageShowCallback, false);
|
||||||
window.location.reload();
|
|
||||||
}, 10);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -323,6 +323,7 @@ export default {
|
||||||
return this.$store.getters.order.payment.inactivePromos;
|
return this.$store.getters.order.payment.inactivePromos;
|
||||||
},
|
},
|
||||||
async revalidatePromos() {
|
async revalidatePromos() {
|
||||||
|
this.$refs.loadingModal.showModal();
|
||||||
const revalidatePromoResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const revalidatePromoResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA,
|
storeActions.REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA,
|
||||||
{
|
{
|
||||||
|
|
@ -344,6 +345,7 @@ export default {
|
||||||
|
|
||||||
this.lineItems.promos = revalidatePromoResponse.promoLineItems;
|
this.lineItems.promos = revalidatePromoResponse.promoLineItems;
|
||||||
this.inactivePromos = revalidatePromoResponse.errors.map((x) => x.promoCode);
|
this.inactivePromos = revalidatePromoResponse.errors.map((x) => x.promoCode);
|
||||||
|
this.$refs.loadingModal.hideModal();
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue