Adds open action instead of connect -> refactoring follows in later PR's
@@ -65,6 +65,9 @@ const mapDispatchToProps = dispatch => {
)
);
},
+ connectionOpen: (connectionUri, message) => {
+ dispatch(actionCreators.connections__open(connectionUri, message));
+ },
};
};
@@ -288,6 +291,9 @@ class WonAddBuddy extends React.Component {
{
caption: "Yes",
callback: () => {
+ if (connectionUtils.isRequestReceived(existingBuddyConnection)) {
+ this.props.open(existingBuddyConnectionUri, message);
+ } else {
this.props.connect(
selectedAtomUri,
existingBuddyConnectionUri,
@@ -296,6 +302,7 @@ class WonAddBuddy extends React.Component {
won.BUDDY.BuddySocketCompacted,
won.BUDDY.BuddySocketCompacted
);
+ }
this.props.hideModalDialog();
},
},
@@ -319,6 +326,7 @@ WonAddBuddy.propTypes = {
hideModalDialog: PropTypes.func,
showModalDialog: PropTypes.func,
connect: PropTypes.func,
+ open: PropTypes.func,
};
export default connect(
