Skip to content

Commit

Permalink
Fix multi-selection test
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 7, 2019
1 parent fdc4a63 commit 14b2cbe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/data/src/components/with-select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,14 @@ const withSelect = ( mapSelectToProps ) => createHigherOrderComponent( ( Wrapped
// Cycle subscription if registry changes.
const hasRegistryChanged = nextProps.registry !== this.props.registry;
const hasSyncRenderingChanged = nextProps.isAsync !== this.props.isAsync;
let shouldComputeProps = false;

if ( hasRegistryChanged ) {
this.unsubscribe();
this.subscribe( nextProps.registry );
}

if ( hasSyncRenderingChanged ) {
shouldComputeProps = flushComponent( this );
flushComponent( this );
}

// Treat a registry change as equivalent to `ownProps`, to reflect
Expand All @@ -135,11 +134,11 @@ const withSelect = ( mapSelectToProps ) => createHigherOrderComponent( ( Wrapped

// Only render if props have changed or merge props have been updated
// from the store subscriber.
if ( this.state === nextState && ! hasPropsChanged && ! shouldComputeProps ) {
if ( this.state === nextState && ! hasPropsChanged && ! hasSyncRenderingChanged ) {
return false;
}

if ( hasPropsChanged || shouldComputeProps ) {
if ( hasPropsChanged || hasSyncRenderingChanged ) {
const nextMergeProps = getNextMergeProps( nextProps );
if ( ! isShallowEqual( this.mergeProps, nextMergeProps ) ) {
// If merge props change as a result of the incoming props,
Expand Down

0 comments on commit 14b2cbe

Please sign in to comment.