From 22ad6b7e0e04f2cc6dda617222384008a7260a6a Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 8 Sep 2021 09:29:39 +0100 Subject: [PATCH 1/2] Ensure result is always iterable --- packages/edit-widgets/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-widgets/src/index.js b/packages/edit-widgets/src/index.js index c45bb294ab46f..51443acddcb87 100644 --- a/packages/edit-widgets/src/index.js +++ b/packages/edit-widgets/src/index.js @@ -37,7 +37,7 @@ import { const disabledBlocks = [ 'core/more', 'core/freeform', - ...( ! ALLOW_REUSABLE_BLOCKS && [ 'core/block' ] ), + ...( ! ALLOW_REUSABLE_BLOCKS ? [ 'core/block' ] : [] ), ]; /** From af9f6442482170f526603f81c942f616757aa514 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 8 Sep 2021 09:45:00 +0100 Subject: [PATCH 2/2] Invert ternary to please the JS gods Co-authored-by: Kai Hao --- packages/edit-widgets/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-widgets/src/index.js b/packages/edit-widgets/src/index.js index 51443acddcb87..0c00388e7c0f2 100644 --- a/packages/edit-widgets/src/index.js +++ b/packages/edit-widgets/src/index.js @@ -37,7 +37,7 @@ import { const disabledBlocks = [ 'core/more', 'core/freeform', - ...( ! ALLOW_REUSABLE_BLOCKS ? [ 'core/block' ] : [] ), + ...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ), ]; /**