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,9 +5,11 @@ import { saveOrder } from "@/helpers/heritage-integration/order-helper.js";
export default {
methods: {
async navigateForwardWithSingleCarMatch() {
// We want to save the order before calling getPartsOrQuestions because that call is lengthy
saveOrder();
// 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) {
saveOrder();
}
const result = await this.dispatchStoreAction(storeActions.GET_PARTS_OR_QUESTIONS);
const partsOrQuestions = result.data.partsOrQuestions;