diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index dc4b08bf..77e64e6d 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -46,8 +46,6 @@ class Network extends Component { updateChannelSearchQuery, - openContactModal, - setSelectedChannel, closeChannel @@ -83,13 +81,17 @@ class Network extends Component { // when the user clicks the action to close the channel const removeClicked = (channel) => { - console.log('channel: ', channel) closeChannel({ channel_point: channel.channel_point, chan_id: channel.chan_id, force: !channel.active }) } // when a user clicks a channel const channelClicked = (channel) => { - selectedChannel === channel ? setSelectedChannel(null) : setSelectedChannel(channel) + // selectedChannel === channel ? setSelectedChannel(null) : setSelectedChannel(channel) + if (selectedChannel === channel) { + setSelectedChannel(null) + } else { + setSelectedChannel(channel) + } } const displayNodeName = (channel) => { @@ -289,13 +291,15 @@ Network.propTypes = { channels: PropTypes.object.isRequired, balance: PropTypes.object.isRequired, currentTicker: PropTypes.object.isRequired, + ticker: PropTypes.object.isRequired, fetchChannels: PropTypes.func.isRequired, openContactsForm: PropTypes.func.isRequired, toggleFilterPulldown: PropTypes.func.isRequired, changeFilter: PropTypes.func.isRequired, updateChannelSearchQuery: PropTypes.func.isRequired, - openContactModal: PropTypes.func.isRequired + setSelectedChannel: PropTypes.func.isRequired, + closeChannel: PropTypes.func.isRequired } export default Network diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js index 5834927d..cad23e15 100644 --- a/app/routes/app/containers/AppContainer.js +++ b/app/routes/app/containers/AppContainer.js @@ -34,7 +34,6 @@ import { toggleFilterPulldown, changeFilter, updateChannelSearchQuery, - openContactModal, closeContactModal, setSelectedChannel } from 'reducers/channels' @@ -111,7 +110,6 @@ const mapDispatchToProps = { toggleFilterPulldown, changeFilter, updateChannelSearchQuery, - openContactModal, closeContactModal, setSelectedChannel, @@ -313,7 +311,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { toggleFilterPulldown: dispatchProps.toggleFilterPulldown, changeFilter: dispatchProps.changeFilter, updateChannelSearchQuery: dispatchProps.updateChannelSearchQuery, - openContactModal: dispatchProps.openContactModal, setSelectedChannel: dispatchProps.setSelectedChannel, closeChannel: dispatchProps.closeChannel } diff --git a/test/reducers/__snapshots__/channels.spec.js.snap b/test/reducers/__snapshots__/channels.spec.js.snap index 6f8dcd6a..518f65af 100644 --- a/test/reducers/__snapshots__/channels.spec.js.snap +++ b/test/reducers/__snapshots__/channels.spec.js.snap @@ -53,6 +53,7 @@ Object { "total_limbo_balance": "", }, "searchQuery": "", + "selectedChannel": null, "viewType": 0, } `; @@ -110,6 +111,7 @@ Object { "total_limbo_balance": "", }, "searchQuery": "", + "selectedChannel": null, "viewType": 0, } `; @@ -168,6 +170,7 @@ Object { 4, ], "searchQuery": "", + "selectedChannel": null, "viewType": 0, } `; @@ -225,6 +228,7 @@ Object { "total_limbo_balance": "", }, "searchQuery": "", + "selectedChannel": null, "viewType": 0, } `; @@ -282,6 +286,7 @@ Object { "total_limbo_balance": "", }, "searchQuery": "", + "selectedChannel": null, "viewType": 0, } `;