-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(simple buy): better balance errs
- Loading branch information
Philip London
committed
Mar 23, 2020
1 parent
f287b9d
commit 183ebff
Showing
15 changed files
with
61 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions
26
packages/blockchain-wallet-v4-frontend/src/scenes/Home/Balances/TotalRow/selectors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { createDeepEqualSelector } from 'services/ReselectHelper' | ||
import { getCoinAndTotalBalances as lockboxBalances } from 'components/Balances/lockbox/selectors' | ||
import { getCoinAndTotalBalances as totalBalances } from 'components/Balances/total/selectors' | ||
import { getCoinAndTotalBalances as walletBalances } from 'components/Balances/wallet/selectors' | ||
import { getTotalBalance as lockboxBalance } from 'components/Balances/lockbox/selectors' | ||
import { getTotalBalance as totalBalance } from 'components/Balances/total/selectors' | ||
import { getTotalBalance as walletBalance } from 'components/Balances/wallet/selectors' | ||
|
||
export const getData = createDeepEqualSelector( | ||
[ | ||
state => lockboxBalances(state), | ||
state => totalBalances(state), | ||
state => walletBalances(state), | ||
(state, { viewType }) => viewType | ||
state => lockboxBalance(state), | ||
state => totalBalance(state), | ||
state => walletBalance(state), | ||
(state, { currentTab }) => currentTab | ||
], | ||
(lockboxBalancesR, totalBalancesR, walletBalancesR, viewType) => { | ||
if (viewType === 'Wallet') { | ||
return walletBalancesR | ||
} else if (viewType === 'Hardware') { | ||
return lockboxBalancesR | ||
(lockboxBalanceR, totalBalanceR, walletBalanceR, currentTab) => { | ||
if (currentTab === 'wallet') { | ||
return walletBalanceR | ||
} else if (currentTab === 'lockbox') { | ||
return lockboxBalanceR | ||
} | ||
return totalBalancesR | ||
return totalBalanceR | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters