From 5c301075e0bca52841decb831a4737080ec6aa56 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Mon, 25 Jun 2018 17:53:31 -0500 Subject: [PATCH] fix(waiting_close_channels): account for waiting_close_channels --- app/components/Contacts/Network.js | 5 +++++ app/reducers/channels.js | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index 32754e7b..f556dc12 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -130,6 +130,11 @@ class Network extends Component { return 'closing' } + // if the channel is in waiting_close_channels phase + if (Object.prototype.hasOwnProperty.call(statusChannel, 'waiting_close_channels')) { + return 'closing' + } + // if we are in the process of closing this channel if (closingChannelIds.includes(statusChannel.chan_id)) { return 'closing' diff --git a/app/reducers/channels.js b/app/reducers/channels.js index cebf0cb5..c74cfe0d 100644 --- a/app/reducers/channels.js +++ b/app/reducers/channels.js @@ -404,6 +404,8 @@ const channelsSelector = state => state.channels.channels const pendingOpenChannelsSelector = state => state.channels.pendingChannels.pending_open_channels const pendingClosedChannelsSelector = state => state.channels.pendingChannels.pending_closing_channels +const pendingWaitingCloseChannelsSelector = state => + state.channels.pendingChannels.waiting_close_channels const pendingForceClosedChannelsSelector = state => state.channels.pendingChannels.pending_force_closing_channels const waitingCloseChannelsSelector = state => state.channels.pendingChannels.waiting_close_channels @@ -457,9 +459,11 @@ channelsSelectors.pendingOpenChannelPubkeys = createSelector( channelsSelectors.closingPendingChannels = createSelector( pendingClosedChannelsSelector, pendingForceClosedChannelsSelector, - (pendingClosedChannels, pendingForcedClosedChannels) => [ + pendingWaitingCloseChannelsSelector, + (pendingClosedChannels, pendingForcedClosedChannels, pendingWaitingCloseChannels) => [ ...pendingClosedChannels, - ...pendingForcedClosedChannels + ...pendingForcedClosedChannels, + ...pendingWaitingCloseChannels ] )