CSR-1055 | Make sure first saveSession call is not asynchronous
This commit is contained in:
parent
b7e8fc5817
commit
2264acbdff
2 changed files with 5 additions and 2 deletions
|
|
@ -111,6 +111,7 @@ import experimentMixin from "@/mixins/experiment-mixin";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -222,7 +223,9 @@ export default {
|
||||||
} else if (this.$store.getters.order.referralNumber?.length === 6) {
|
} else if (this.$store.getters.order.referralNumber?.length === 6) {
|
||||||
await this.navigateForwardWithSingleCarMatch();
|
await this.navigateForwardWithSingleCarMatch();
|
||||||
} else if (this.isRepair) {
|
} 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.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export default {
|
||||||
async navigateForwardWithSingleCarMatch() {
|
async navigateForwardWithSingleCarMatch() {
|
||||||
// If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
|
// 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) {
|
if (!store.getters.applicationUser.savedSessionId) {
|
||||||
saveSession();
|
await saveSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue