Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(wallet): improve channels menu balance display
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Sep 18, 2020
1 parent 5f595ad commit 0a17bec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion renderer/containers/Channels/ChannelsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { channelsSelectors } from 'reducers/channels'
const mapStateToProps = state => ({
cryptoUnitName: tickerSelectors.cryptoUnitName(state),
lightningBalance: balanceSelectors.channelBalanceConfirmed(state),
pendingBalance: balanceSelectors.channelBalancePending(state),
pendingBalance: balanceSelectors.pendingBalance(state),
onchainBalance: balanceSelectors.walletBalance(state),
channelCount: channelsSelectors.allChannelsCount(state),
})
Expand Down
11 changes: 11 additions & 0 deletions renderer/reducers/balance/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ export const walletBalanceUnconfirmed = state => state.balance.walletBalanceUnco
*/
export const limboBalance = state => state.channels.pendingChannels.totalLimboBalance

/**
* pendingBalance - Pending balance.
*
* @param {State} state Redux state
* @returns {string|null} Pending balance
*/
export const pendingBalance = createSelector(channelBalancePending, limboBalance, (cb, lb) => {
return CoinBig.sum(cb, lb).toString()
})

/**
* totalBalance - Total balance.
*
Expand Down Expand Up @@ -96,5 +106,6 @@ export default {
walletBalanceConfirmed,
walletBalanceUnconfirmed,
limboBalance,
pendingBalance,
totalBalance,
}

0 comments on commit 0a17bec

Please sign in to comment.