Browse Source

Merge pull request #385 from LN-Zap/fix/WaitingCloseChannel

Fix/waiting close channel
renovate/lint-staged-8.x
JimmyMow 7 years ago
committed by GitHub
parent
commit
c1c2e445f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      app/reducers/channels.js
  2. 4
      test/reducers/__snapshots__/channels.spec.js.snap

12
app/reducers/channels.js

@ -380,6 +380,7 @@ 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 pendingForceClosedChannelsSelector = state => state.channels.pendingChannels.pending_force_closing_channels
const waitingCloseChannelsSelector = state => state.channels.pendingChannels.waiting_close_channels
const channelSearchQuerySelector = state => state.channels.searchQuery
const filtersSelector = state => state.channels.filters
const filterSelector = state => state.channels.filter
@ -453,8 +454,9 @@ const allChannels = createSelector(
pendingOpenChannelsSelector,
pendingClosedChannelsSelector,
pendingForceClosedChannelsSelector,
waitingCloseChannelsSelector,
channelSearchQuerySelector,
(activeChannels, nonActiveChannels, pendingOpenChannels, pendingClosedChannels, pendingForcedClosedChannels, searchQuery) => {
(activeChannels, nonActiveChannels, pendingOpenChannels, pendingClosedChannels, pendingForcedClosedChannels, waitingCloseChannels, searchQuery) => {
const filterChannel = channel =>
channel.remote_pubkey.includes(searchQuery) || channel.channel_point.includes(searchQuery)
@ -467,13 +469,15 @@ const allChannels = createSelector(
const filteredPendingOpenChannels = pendingOpenChannels.filter(filterPendingChannel)
const filteredPendingClosedChannels = pendingClosedChannels.filter(filterPendingChannel)
const filteredPendingForcedClosedChannels = pendingForcedClosedChannels.filter(filterPendingChannel)
const filteredWaitingCloseChannels = waitingCloseChannels.filter(filterPendingChannel)
return [
...filteredActiveChannels,
...filteredPendingOpenChannels,
...filteredPendingClosedChannels,
...filteredPendingForcedClosedChannels,
...filteredNonActiveChannels
...filteredNonActiveChannels,
...filteredWaitingCloseChannels
]
}
)
@ -508,6 +512,7 @@ export const currentChannels = createSelector(
}
}
const channelArray = filteredArray(channelFilter.key)
return channelArray.filter(channel => (Object.prototype.hasOwnProperty.call(channel, 'channel') ?
@ -529,7 +534,8 @@ const initialState = {
total_limbo_balance: '',
pending_open_channels: [],
pending_closing_channels: [],
pending_force_closing_channels: []
pending_force_closing_channels: [],
waiting_close_channels: []
},
channel: null,
channelForm: {

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

@ -51,6 +51,7 @@ Object {
"pending_force_closing_channels": Array [],
"pending_open_channels": Array [],
"total_limbo_balance": "",
"waiting_close_channels": Array [],
},
"searchQuery": "",
"selectedChannel": null,
@ -114,6 +115,7 @@ Object {
"pending_force_closing_channels": Array [],
"pending_open_channels": Array [],
"total_limbo_balance": "",
"waiting_close_channels": Array [],
},
"searchQuery": "",
"selectedChannel": null,
@ -241,6 +243,7 @@ Object {
"pending_force_closing_channels": Array [],
"pending_open_channels": Array [],
"total_limbo_balance": "",
"waiting_close_channels": Array [],
},
"searchQuery": "",
"selectedChannel": null,
@ -304,6 +307,7 @@ Object {
"pending_force_closing_channels": Array [],
"pending_open_channels": Array [],
"total_limbo_balance": "",
"waiting_close_channels": Array [],
},
"searchQuery": "",
"selectedChannel": null,

Loading…
Cancel
Save