From b02f6318887e3134bec67fd7c171205b1398f8ee Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 23 Jul 2021 15:44:16 +0100 Subject: [PATCH] Enrich button actions nested inside conditions --- packages/client/src/utils/componentProps.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/client/src/utils/componentProps.js b/packages/client/src/utils/componentProps.js index 65e86c28d6..5472c57308 100644 --- a/packages/client/src/utils/componentProps.js +++ b/packages/client/src/utils/componentProps.js @@ -43,5 +43,17 @@ export const enrichProps = (props, context) => { ) } + // Enrich any click actions in conditions + if (enrichedProps._conditions) { + enrichedProps._conditions.forEach(condition => { + if (condition.setting === "onClick") { + condition.settingValue = enrichButtonActions( + condition.settingValue, + totalContext + ) + } + }) + } + return enrichedProps }