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