Browse Source

fix(lint/tests): fix lint errors and gen new snapshots

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
0ea5cc743e
  1. 14
      app/components/Contacts/Network.js
  2. 3
      app/routes/app/containers/AppContainer.js
  3. 5
      test/reducers/__snapshots__/channels.spec.js.snap

14
app/components/Contacts/Network.js

@ -46,8 +46,6 @@ class Network extends Component {
updateChannelSearchQuery, updateChannelSearchQuery,
openContactModal,
setSelectedChannel, setSelectedChannel,
closeChannel closeChannel
@ -83,13 +81,17 @@ class Network extends Component {
// when the user clicks the action to close the channel // when the user clicks the action to close the channel
const removeClicked = (channel) => { const removeClicked = (channel) => {
console.log('channel: ', channel)
closeChannel({ channel_point: channel.channel_point, chan_id: channel.chan_id, force: !channel.active }) closeChannel({ channel_point: channel.channel_point, chan_id: channel.chan_id, force: !channel.active })
} }
// when a user clicks a channel // when a user clicks a channel
const channelClicked = (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) => { const displayNodeName = (channel) => {
@ -289,13 +291,15 @@ Network.propTypes = {
channels: PropTypes.object.isRequired, channels: PropTypes.object.isRequired,
balance: PropTypes.object.isRequired, balance: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired, currentTicker: PropTypes.object.isRequired,
ticker: PropTypes.object.isRequired,
fetchChannels: PropTypes.func.isRequired, fetchChannels: PropTypes.func.isRequired,
openContactsForm: PropTypes.func.isRequired, openContactsForm: PropTypes.func.isRequired,
toggleFilterPulldown: PropTypes.func.isRequired, toggleFilterPulldown: PropTypes.func.isRequired,
changeFilter: PropTypes.func.isRequired, changeFilter: PropTypes.func.isRequired,
updateChannelSearchQuery: PropTypes.func.isRequired, updateChannelSearchQuery: PropTypes.func.isRequired,
openContactModal: PropTypes.func.isRequired setSelectedChannel: PropTypes.func.isRequired,
closeChannel: PropTypes.func.isRequired
} }
export default Network export default Network

3
app/routes/app/containers/AppContainer.js

@ -34,7 +34,6 @@ import {
toggleFilterPulldown, toggleFilterPulldown,
changeFilter, changeFilter,
updateChannelSearchQuery, updateChannelSearchQuery,
openContactModal,
closeContactModal, closeContactModal,
setSelectedChannel setSelectedChannel
} from 'reducers/channels' } from 'reducers/channels'
@ -111,7 +110,6 @@ const mapDispatchToProps = {
toggleFilterPulldown, toggleFilterPulldown,
changeFilter, changeFilter,
updateChannelSearchQuery, updateChannelSearchQuery,
openContactModal,
closeContactModal, closeContactModal,
setSelectedChannel, setSelectedChannel,
@ -313,7 +311,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
toggleFilterPulldown: dispatchProps.toggleFilterPulldown, toggleFilterPulldown: dispatchProps.toggleFilterPulldown,
changeFilter: dispatchProps.changeFilter, changeFilter: dispatchProps.changeFilter,
updateChannelSearchQuery: dispatchProps.updateChannelSearchQuery, updateChannelSearchQuery: dispatchProps.updateChannelSearchQuery,
openContactModal: dispatchProps.openContactModal,
setSelectedChannel: dispatchProps.setSelectedChannel, setSelectedChannel: dispatchProps.setSelectedChannel,
closeChannel: dispatchProps.closeChannel closeChannel: dispatchProps.closeChannel
} }

5
test/reducers/__snapshots__/channels.spec.js.snap

@ -53,6 +53,7 @@ Object {
"total_limbo_balance": "", "total_limbo_balance": "",
}, },
"searchQuery": "", "searchQuery": "",
"selectedChannel": null,
"viewType": 0, "viewType": 0,
} }
`; `;
@ -110,6 +111,7 @@ Object {
"total_limbo_balance": "", "total_limbo_balance": "",
}, },
"searchQuery": "", "searchQuery": "",
"selectedChannel": null,
"viewType": 0, "viewType": 0,
} }
`; `;
@ -168,6 +170,7 @@ Object {
4, 4,
], ],
"searchQuery": "", "searchQuery": "",
"selectedChannel": null,
"viewType": 0, "viewType": 0,
} }
`; `;
@ -225,6 +228,7 @@ Object {
"total_limbo_balance": "", "total_limbo_balance": "",
}, },
"searchQuery": "", "searchQuery": "",
"selectedChannel": null,
"viewType": 0, "viewType": 0,
} }
`; `;
@ -282,6 +286,7 @@ Object {
"total_limbo_balance": "", "total_limbo_balance": "",
}, },
"searchQuery": "", "searchQuery": "",
"selectedChannel": null,
"viewType": 0, "viewType": 0,
} }
`; `;

Loading…
Cancel
Save