1
0
Fork 0
mirror of synced 2024-08-18 03:21:29 +12:00

Return nullish button action function for empty arrays

This commit is contained in:
Andrew Kingston 2022-08-17 15:43:25 +01:00
parent 4bc2c7a28f
commit 1a23970a38

View file

@ -334,8 +334,8 @@ const confirmTextMap = {
*/ */
export const enrichButtonActions = (actions, context) => { export const enrichButtonActions = (actions, context) => {
// Prevent button actions in the builder preview // Prevent button actions in the builder preview
if (!actions || get(builderStore).inBuilder) { if (!actions?.length || get(builderStore).inBuilder) {
return () => {} return null
} }
// If this is a function then it has already been enriched // If this is a function then it has already been enriched