Skip to content

Commit

Permalink
Sharing: fix button state when number of connections does not change …
Browse files Browse the repository at this point in the history
…h/t @obenland
  • Loading branch information
gwwar committed Apr 3, 2017
1 parent feef878 commit 321237d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/my-sites/sharing/connections/service.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import { connect } from 'react-redux';
import { identity, find, replace, some } from 'lodash';
import { identity, isEqual, find, replace, some } from 'lodash';
import { localize } from 'i18n-calypso';
import SocialLogo from 'social-logos';

Expand Down Expand Up @@ -234,15 +234,15 @@ class SharingService extends Component {
}

componentWillReceiveProps( nextProps ) {
if ( this.props.siteUserConnections.length !== nextProps.siteUserConnections.length ) {
if ( ! isEqual( this.props.siteUserConnections, nextProps.siteUserConnections ) ) {
this.setState( {
isConnecting: false,
isDisconnecting: false,
isSelectingAccount: false,
} );
}

if ( this.props.brokenConnections.length !== nextProps.brokenConnections.length ) {
if ( ! isEqual( this.props.brokenConnections, nextProps.brokenConnections ) ) {
this.setState( { isRefreshing: false } );
}

Expand Down

0 comments on commit 321237d

Please sign in to comment.