CSR-108: allow for cases where there is no damage state saved

This commit is contained in:
Adam Caouette 2022-08-19 10:37:57 -04:00
parent 53f1b61176
commit 813cd34009

View file

@ -997,7 +997,7 @@ export const actions = {
savePartQuestionAnswers(context, partQuestionAnswersArray) {
// if part question answers have changed, reset subsequent question answers
const previousResultsArray = context.getters.damage.partQuestionAnswers;
const havePartQuestionAnswersChanged = previousResultsArray.length !== partQuestionAnswersArray.length ||
const havePartQuestionAnswersChanged = previousResultsArray?.length !== partQuestionAnswersArray.length ||
!previousResultsArray.every((x, i) => x.result === partQuestionAnswersArray[i].result);
if (havePartQuestionAnswersChanged) {