From fbd7da0856f150c161674627a894342a8a8bf641 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Fri, 6 Jan 2023 11:32:20 +0000 Subject: [PATCH] Fix offsite navigation editor component loading issue. (#46937) --- .../src/components/off-canvas-editor/block-contents.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/off-canvas-editor/block-contents.js b/packages/block-editor/src/components/off-canvas-editor/block-contents.js index c2cbd970b09b9b..7dfa98fb60e261 100644 --- a/packages/block-editor/src/components/off-canvas-editor/block-contents.js +++ b/packages/block-editor/src/components/off-canvas-editor/block-contents.js @@ -53,11 +53,14 @@ const ListViewBlockContents = forwardRef( getSelectedBlockClientId, getLastInsertedBlocksClientIds, } = select( blockEditorStore ); + const lastInsertedBlocksClientIds = + getLastInsertedBlocksClientIds(); return { blockMovingClientId: hasBlockMovingClientId(), selectedBlockInBlockEditor: getSelectedBlockClientId(), lastInsertedBlockClientId: - getLastInsertedBlocksClientIds()[ 0 ], + lastInsertedBlocksClientIds && + lastInsertedBlocksClientIds[ 0 ], }; }, [ clientId ]