Change if statement
Issue
@@ -357,10 +357,8 @@ export function needsClose(needUri) {
//Close all the open connections of the need
const affectedConnections = getState().getIn(['needs', needUri, 'connections']).map(conn => conn && conn.get("uri"));
- for (con in affectedConnections.toJS()) {
- console.log("Connection: " + con);
- var conState = getState().getIn(['needs', needUri, 'connections', con, 'state'])
- if(conState == won.WON.Active) {
+ for (con in affectedConnections.toJSON()) {
+ if( getState().getIn(['needs', needUri, 'connections', con, 'state']) === won.WON.Connected) {
dispatch(actionCreators.connections__close(con),
)
}
