CSR-1055 | Make sure first saveSession call is not asynchronous

This commit is contained in:
Scott Kiener 2023-01-11 10:15:20 -05:00
parent b7e8fc5817
commit 2264acbdff
2 changed files with 5 additions and 2 deletions

View file

@ -111,6 +111,7 @@ import experimentMixin from "@/mixins/experiment-mixin";
import { experimentSettings } from "@/constants/experiments";
import vinPagesMixin from "@/mixins/vin-pages-mixin";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
// Define Validation Rules
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
@ -222,7 +223,9 @@ export default {
} else if (this.$store.getters.order.referralNumber?.length === 6) {
await this.navigateForwardWithSingleCarMatch();
} else if (this.isRepair) {
return this.$router.navigateWithSaving(
// call saveSession here - navigateWithSaving only saves asynchronously
await saveSession();
return this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
this.$route
);

View file

@ -8,7 +8,7 @@ export default {
async navigateForwardWithSingleCarMatch() {
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
if (!store.getters.applicationUser.savedSessionId) {
saveSession();
await saveSession();
}
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);