Skip to content

Commit

Permalink
Small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 4, 2019
1 parent 88897af commit 860fec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default compose( [
return {
title: getEditedPostAttribute( 'title' ),
hasItems: hasInserterItems( rootClientId ),
rootClientId: rootClientId || getBlockInsertionPoint().rootClientId,
rootClientId,
};
} ),
ifCondition( ( { hasItems } ) => hasItems ),
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ export default compose(
hideInsertionPoint,
} = dispatch( 'core/editor' );

// To avoid duplication, getInsertionPoint is extracted and used in two event handlers
// This breaks the withDispatch not containing any logic rule.
// Since it's a function only called when the event handlers are called,
// it's fine to extract it.
// eslint-disable-next-line no-restricted-syntax
function getInsertionPoint() {
const {
Expand Down

0 comments on commit 860fec0

Please sign in to comment.