From ad706c9f7a5864b213ef2fcc6fd5548886b15ef0 Mon Sep 17 00:00:00 2001 From: Jorge Date: Fri, 6 Jan 2023 11:29:40 +0000 Subject: [PATCH] Fix offsite navigation editor component loading issue. --- .../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 ]