From bb9146b93ff6356669f80c7f954b53b8ecfaedc7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 17 Aug 2022 15:43:25 +0100 Subject: [PATCH] Return nullish button action function for empty arrays --- packages/client/src/utils/buttonActions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index c6f46d1c67..558cab8f21 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -334,8 +334,8 @@ const confirmTextMap = { */ export const enrichButtonActions = (actions, context) => { // Prevent button actions in the builder preview - if (!actions || get(builderStore).inBuilder) { - return () => {} + if (!actions?.length || get(builderStore).inBuilder) { + return null } // If this is a function then it has already been enriched