From b628c59364d5391fd1e3c852a037e85c06b8ae1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20G=C3=BCnther?= Date: Fri, 13 Dec 2024 11:29:38 +0100 Subject: [PATCH] BUGFIX: Prevent proptype warning regarding canBePasted property (#3900) If clipboardNodesContextPaths.length is 0, this part will be interpreted as false (because 0 is considered "falsy" in JavaScript). The entire expression will then be 0 without evaluating the second part. This happens due to short-circuit evaluation in JavaScript. With this change we ensure that the value is always a boolean value. --- .../InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js b/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js index c9bebb3b53..fecf882255 100644 --- a/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js +++ b/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js @@ -15,7 +15,7 @@ import {selectors, actions} from '@neos-project/neos-ui-redux-store'; return (state, {contextPath}) => { const clipboardNodesContextPaths = selectors.CR.Nodes.clipboardNodesContextPathsSelector(state); - const canBePasted = clipboardNodesContextPaths.length && (clipboardNodesContextPaths.every(clipboardNodeContextPath => { + const canBePasted = Boolean(clipboardNodesContextPaths.length && clipboardNodesContextPaths.every(clipboardNodeContextPath => { return canBePastedSelector(state, { subject: clipboardNodeContextPath, reference: contextPath