Browse Source

Return nullish button action function for empty arrays

master
Andrew Kingston 4 years ago
parent
commit
bb9146b93f
  1. 4
      packages/client/src/utils/buttonActions.js

4
packages/client/src/utils/buttonActions.js

@ -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

Loading…
Cancel
Save