Ensuring vin lookup page saveOrder is only triggered when we don't already have a session saved

This commit is contained in:
Leah Schumann 2022-08-22 16:29:29 -04:00
parent 520fdbd674
commit 3e41d4de98

View file

@ -5,8 +5,10 @@ import { saveOrder } from "@/helpers/heritage-integration/order-helper.js";
export default { export default {
methods: { methods: {
async navigateForwardWithSingleCarMatch() { async navigateForwardWithSingleCarMatch() {
// We want to save the order before calling getPartsOrQuestions because that call is lengthy // If we have not already saved a session, we need to save one now before the lengthy call to getPartsOrQuestions
saveOrder(); if (!store.getters.applicationUser.savedSessionId) {
saveOrder();
}
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS); const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
const partsOrQuestions = result.data.partsOrQuestions; const partsOrQuestions = result.data.partsOrQuestions;