move promise reset to after we await all save sessions (submitWOrkOrder)
This commit is contained in:
CarlNation 2023-10-25 16:55:31 -04:00
parent f6bdd4a272
commit 67fe2e0177

View file

@ -303,14 +303,12 @@ export default {
async setupPia() {
this.$refs.loadingModal.showModal();
// since we're leaving the site for pia, clear any save session promises that we will not be able to resolve when we return
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
// if we don't have a work order in delete substatus, set the flag and submit
if (!store.getters.order.workOrderNumber) {
this.dispatchStoreAction(storeActions.SAVE_PIA_WORK_ORDER, true);
await submitWorkOrder({ pageNameToLog: "payment-method" });
this.dispatchStoreAction(storeActions.SAVE_PIA_WORK_ORDER, false);
this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
}
this.$router.navigateWithoutSaving(