Skip to content

Commit

Permalink
Update to use clientId
Browse files Browse the repository at this point in the history
  • Loading branch information
notnownikki committed Jul 19, 2018
1 parent ec6850a commit d412ad3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editor/components/block-controls/multi-block-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const withMultiBlockSupport = ( component, attributeName ) => createHighe
[ attributeName ]: newValue,
};
for ( let i = 0; i < props.multiSelectedBlocks.length; i++ ) {
newProps.onMultiBlockChange( props.multiSelectedBlocks[ i ].uid, newAttributes );
newProps.onMultiBlockChange( props.multiSelectedBlocks[ i ].clientId, newAttributes );
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions editor/components/block-edit/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const isFirstOrOnlyBlockSelectedHOC = createHigherOrderComponent( ( OriginalComp
return ( props ) => {
return (
<Consumer>
{ ( { isSelected, uid } ) => ( isSelected || ( uid === props.firstMultiSelectedBlockUid && props.allSelectedBlocksOfSameType ) ) && (
{ ( { isSelected, clientId } ) => ( isSelected || ( clientId === props.getFirstMultiSelectedBlockClientId && props.allSelectedBlocksOfSameType ) ) && (
<OriginalComponent { ...props } />
) }
</Consumer>
Expand All @@ -88,12 +88,12 @@ export const isFirstOrOnlyBlockSelected = ( component ) => {
withSelect( ( select ) => {
const {
getMultiSelectedBlocks,
getFirstMultiSelectedBlockUid,
getFirstMultiSelectedBlockClientId,
isMultiSelecting,
} = select( 'core/editor' );
const allSelectedBlocksOfSameType = uniq( getMultiSelectedBlocks().map( ( { name } ) => name ) ).length === 1;
return {
firstMultiSelectedBlockUid: getFirstMultiSelectedBlockUid(),
getFirstMultiSelectedBlockClientId: getFirstMultiSelectedBlockClientId(),
isSelecting: isMultiSelecting(),
selectedBlocks: getMultiSelectedBlocks(),
allSelectedBlocksOfSameType,
Expand Down

0 comments on commit d412ad3

Please sign in to comment.