Skip to content

Commit

Permalink
Revert "Show the block appender even if the last block is non empty p…
Browse files Browse the repository at this point in the history
…aragraph"

This reverts commit 5bb5310.
  • Loading branch information
aduth committed Mar 12, 2018
1 parent fc26eb7 commit 6e12185
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/components/default-block-appender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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,
};
},
Expand Down

0 comments on commit 6e12185

Please sign in to comment.