From 6e12185d93210fbe93bb238ea2b45e5e8d00567f Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 9 Mar 2018 16:51:37 -0500 Subject: [PATCH] Revert "Show the block appender even if the last block is non empty paragraph" This reverts commit 5bb5310d1a29d28cccf168a9849b66f20ae2f09c. --- editor/components/default-block-appender/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/components/default-block-appender/index.js b/editor/components/default-block-appender/index.js index 14ec4d24114aa..c53b1049f6911 100644 --- a/editor/components/default-block-appender/index.js +++ b/editor/components/default-block-appender/index.js @@ -2,13 +2,14 @@ * External dependencies */ import { connect } from 'react-redux'; +import { get } from 'lodash'; /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { compose } from '@wordpress/element'; -import { isUnmodifiedDefaultBlock } from '@wordpress/blocks'; +import { getDefaultBlockName } from '@wordpress/blocks'; import { withContext } from '@wordpress/components'; /** @@ -50,10 +51,10 @@ export default compose( ( state, ownProps ) => { const isEmpty = ! getBlockCount( state, ownProps.rootUID ); const lastBlock = getBlock( state, ownProps.lastBlockUID ); - const isLastBlockEmptyDefault = lastBlock && isUnmodifiedDefaultBlock( lastBlock ); + const isLastBlockDefault = get( lastBlock, 'name' ) === getDefaultBlockName(); return { - isVisible: isEmpty || ! isLastBlockEmptyDefault, + isVisible: isEmpty || ! isLastBlockDefault, showPrompt: isEmpty, }; },