Skip to content

Commit 841e99d

Browse files
Chartman123backportbot[bot]
authored andcommitted
fix: prevent overwriting previous answers during initialization
Signed-off-by: Christian Hartmann <[email protected]>
1 parent dfcb2ea commit 841e99d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/views/Submit.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,11 @@ export default {
611611
for (const answer of loadedAnswers) {
612612
const questionId = answer.questionId
613613
const text = answer.text
614-
answers[questionId] = []
614+
615+
// Only initialize once, don't overwrite previous answers
616+
if (!answers[questionId]) {
617+
answers[questionId] = []
618+
}
615619
616620
logger.debug(`questionId: ${questionId}, answerId: ${answer.id}`)
617621
// Clean up answers for questions that do not exist anymore

0 commit comments

Comments
 (0)