From da4ae24675854a8bc45f55d163d12f946b4bbdc6 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Wed, 20 Jun 2018 19:48:46 -0500 Subject: [PATCH 1/2] fix(channels): fix invalid assignment error that was not allowing channel details to toggle open on click in production builds --- app/components/Contacts/Network.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index 2fbbb4ff..a3804e43 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -82,12 +82,12 @@ class Network extends Component { } // when a user clicks a channel - const channelClicked = channel => { + const channelClicked = clickedChannel => { // selectedChannel === channel ? setSelectedChannel(null) : setSelectedChannel(channel) - if (selectedChannel === channel) { + if (selectedChannel === clickedChannel) { setSelectedChannel(null) } else { - setSelectedChannel(channel) + setSelectedChannel(clickedChannel) } } From 3adf4620e02bac5a9bbb9b483da372052cce7099 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Thu, 21 Jun 2018 13:19:26 -0500 Subject: [PATCH 2/2] fix(channels): fix invalid assignment error for removeClicked, displayNodeName and channelStatus --- app/components/Contacts/Network.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index a3804e43..d6a191e8 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -77,8 +77,8 @@ class Network extends Component { } // when the user clicks the action to close the channel - const removeClicked = channel => { - closeChannel({ channel_point: channel.channel_point, chan_id: channel.chan_id, force: !channel.active }) + const removeClicked = removeChannel => { + closeChannel({ channel_point: removeChannel.channel_point, chan_id: removeChannel.chan_id, force: !removeChannel.active }) } // when a user clicks a channel @@ -91,34 +91,34 @@ class Network extends Component { } } - const displayNodeName = channel => { - const node = find(nodes, n => channel.remote_pubkey === n.pub_key) + const displayNodeName = displayedChannel => { + const node = find(nodes, n => displayedChannel.remote_pubkey === n.pub_key) if (node && node.alias.length) { return node.alias } - return channel.remote_pubkey ? channel.remote_pubkey.substring(0, 10) : channel.remote_node_pub.substring(0, 10) + return displayedChannel.remote_pubkey ? displayedChannel.remote_pubkey.substring(0, 10) : displayedChannel.remote_node_pub.substring(0, 10) } - const channelStatus = channel => { + const channelStatus = statusChannel => { // if the channel has a confirmation_height property that means it's pending - if (Object.prototype.hasOwnProperty.call(channel, 'confirmation_height')) { + if (Object.prototype.hasOwnProperty.call(statusChannel, 'confirmation_height')) { return 'pending' } // if the channel has a closing tx that means it's closing - if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) { + if (Object.prototype.hasOwnProperty.call(statusChannel, 'closing_txid')) { return 'closing' } // if we are in the process of closing this channel - if (closingChannelIds.includes(channel.chan_id)) { + if (closingChannelIds.includes(statusChannel.chan_id)) { return 'closing' } // if the channel isn't active that means the remote peer isn't online - if (!channel.active) { + if (!statusChannel.active) { return 'offline' }