From 12e5546ff3c878cc58e7ac7fd7ebd2278cfd9f82 Mon Sep 17 00:00:00 2001 From: Favour Olayinka Date: Tue, 14 May 2024 18:35:56 +0100 Subject: [PATCH] fix store content bug (#410) --- client/stores/working_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/stores/working_form.js b/client/stores/working_form.js index eab5c4d6..0ff671dd 100644 --- a/client/stores/working_form.js +++ b/client/stores/working_form.js @@ -105,6 +105,7 @@ export const useWorkingFormStore = defineStore("working_form", { }, addBlock(type, index = null) { + this.selectedFieldIndex = index this.blockForm.type = type this.blockForm.name = defaultBlockNames[type] const newBlock = this.prefillDefault(this.blockForm.data()) @@ -135,7 +136,7 @@ export const useWorkingFormStore = defineStore("working_form", { newFields.push(newBlock) this.content.properties = newFields this.openSettingsForField( - this.form.properties.length - 1, + this.content.properties.length - 1, ) } else { const fieldIndex = typeof index === "number" ? index : this.selectedFieldIndex + 1