From c5ec2ed230847bbd9ebe4a4befa52925bfdecefa Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 5 Feb 2026 11:56:22 +0200 Subject: [PATCH] fix document condition --- app/javascript/submission_form/form.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue index 92d02f8f..e3a3fadd 100644 --- a/app/javascript/submission_form/form.vue +++ b/app/javascript/submission_form/form.vue @@ -1255,11 +1255,11 @@ export default { } }, checkFieldConditions (field, cache = {}) { - if (cache[field.uuid] !== undefined) { - return cache[field.uuid] - } + const cacheKey = field.uuid || field.attachment_uuid - cache[field.uuid] = true + if (cache[cacheKey] !== undefined) { + return cache[cacheKey] + } if (field.conditions?.length) { const result = field.conditions.reduce((acc, cond) => { @@ -1272,10 +1272,12 @@ export default { return acc }, []) - cache[field.uuid] = !result.includes(false) + cache[cacheKey] = !result.includes(false) + } else { + cache[cacheKey] = true } - return cache[field.uuid] + return cache[cacheKey] }, checkFieldCondition (condition, cache = {}) { const field = this.fieldsUuidIndex[condition.field_uuid]