CSR-1610: another attempt to fix load issue for saved sessions

This commit is contained in:
Adam Caouette 2024-01-08 13:53:31 -05:00
parent 0b84b7f7a0
commit 3f109d244e

View file

@ -5,11 +5,13 @@
:isMetaValid="meta.valid"
:alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader"
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
v-if="questionsData"
:questionsData="questionsData"
validationRules="questions-required"
v-model="selectedAnswers"
@forwardButtonAction="forwardButtonAction"
@back-click="navigateBack"
:key="currentGlassIndex"
:index="currentGlassIndex" />
</Form>
</template>
@ -55,7 +57,7 @@ export default {
},
data() {
return {
questionsData: [],
questionsData: null,
selectedAnswers: {},
currentGlassIndex: 0,
};
@ -71,7 +73,7 @@ export default {
return this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS).partsOrQuestions;
},
},
created() {
mounted() {
this.getInitialQuestionData();
},
methods: {
@ -117,6 +119,14 @@ export default {
return updatedGlass;
});
// if no preanswered questions then make sure index starts with the correct value
if (this.currentGlassIndex === 0) {
this.currentGlassIndex = this.questionsData?.findIndex(
(glass) => glass.questions?.length > 0
);
}
},
async forwardButtonAction() {
const questionAnswersArray = this.questionsData.map((glass) => {