diff --git a/package.json b/package.json index ff89aa4a2..5f6a80666 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#7bd6ae1824f9241fdaea6441558fb52f0e465553", + "lbry-redux": "lbryio/lbry-redux#ba141f762b1802bd937c2dec8ac0140c708d4df6", "lbryinc": "lbryio/lbryinc#eee2cb730ecec95a1344a755035755b0d4dad5cf", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/static/app-strings.json b/static/app-strings.json index db3a991ef..bbb73a59e 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1564,5 +1564,7 @@ "Deposit cannot be higher than your available balance: %balance%": "Deposit cannot be higher than your available balance: %balance%", "This channel has disabled comments on their page.": "This channel has disabled comments on their page.", "The creator of this content has disabled comments.": "The creator of this content has disabled comments.", + "These %lbc% help your content in search rankings. You can unlock them but that's less fun. %unlock%": "These %lbc% help your content in search rankings. You can unlock them but that's less fun. %unlock%", + "You have a lot of tips. This could take some time.": "You have a lot of tips. This could take some time.", "--end--": "--end--" } diff --git a/ui/component/walletBalance/index.js b/ui/component/walletBalance/index.js index edd22e69e..83b0a30cf 100644 --- a/ui/component/walletBalance/index.js +++ b/ui/component/walletBalance/index.js @@ -8,8 +8,10 @@ import { selectUtxoCounts, doFetchUtxoCounts, doUtxoConsolidate, - selectPendingOtherTransactions, selectIsConsolidatingUtxos, + selectIsMassClaimingTips, + selectPendingConsolidateTxid, + selectPendingMassClaimTxid, } from 'lbry-redux'; import { doOpenModal } from 'redux/actions/app'; import { selectSyncHash } from 'redux/selectors/sync'; @@ -25,8 +27,10 @@ const select = state => ({ hasSynced: Boolean(selectSyncHash(state)), fetchingUtxoCounts: selectIsFetchingUtxoCounts(state), consolidatingUtxos: selectIsConsolidatingUtxos(state), + massClaimingTips: selectIsMassClaimingTips(state), utxoCounts: selectUtxoCounts(state), - pendingUtxoConsolidating: selectPendingOtherTransactions(state), + consolidateIsPending: selectPendingConsolidateTxid(state), + massClaimIsPending: selectPendingMassClaimTxid(state), }); export default connect(select, { diff --git a/ui/component/walletBalance/view.jsx b/ui/component/walletBalance/view.jsx index fa4ea247b..74829a840 100644 --- a/ui/component/walletBalance/view.jsx +++ b/ui/component/walletBalance/view.jsx @@ -23,11 +23,13 @@ type Props = { doUtxoConsolidate: () => void, fetchingUtxoCounts: boolean, consolidatingUtxos: boolean, + consolidateIsPending: boolean, + massClaimingTips: boolean, + massClaimIsPending: boolean, utxoCounts: { [string]: number }, - pendingUtxoConsolidating: Array, }; -const WALLET_CONSOLIDATE_UTXOS = 400; +export const WALLET_CONSOLIDATE_UTXOS = 400; const LARGE_WALLET_BALANCE = 100; const WalletBalance = (props: Props) => { @@ -38,23 +40,27 @@ const WalletBalance = (props: Props) => { tipsBalance, doOpenModal, hasSynced, - pendingUtxoConsolidating, doUtxoConsolidate, doFetchUtxoCounts, consolidatingUtxos, + consolidateIsPending, + massClaimingTips, + massClaimIsPending, utxoCounts, } = props; const [detailsExpanded, setDetailsExpanded] = React.useState(false); + const { other: otherCount = 0 } = utxoCounts || {}; const totalBalance = balance + tipsBalance + supportsBalance + claimsBalance; const totalLocked = tipsBalance + claimsBalance + supportsBalance; + const operationPending = massClaimIsPending || massClaimingTips || consolidateIsPending || consolidatingUtxos; React.useEffect(() => { - if (balance > LARGE_WALLET_BALANCE) { + if (balance > LARGE_WALLET_BALANCE && detailsExpanded) { doFetchUtxoCounts(); } - }, [doFetchUtxoCounts, balance]); + }, [doFetchUtxoCounts, balance, detailsExpanded]); return ( { actions={ <>

- }}> + }}> %lbc_amount% immediately spendable

@@ -79,7 +85,7 @@ const WalletBalance = (props: Props) => {

, + lbc_amount: , }} > %lbc_amount% boosting content @@ -95,27 +101,38 @@ const WalletBalance = (props: Props) => {
- {__('...earned from others')} + {__('...earned from others')} ({__('Unlock to spend')})
- + + {Boolean(tipsBalance) && ( +
- {__('...on initial publishes')} + {__('...on initial publishes')} ({__('Delete or edit past content to spend')})
- +
- {__('...supporting content')} + {__('...supporting content')} ({__('Delete supports to spend')})
- +
@@ -149,7 +166,7 @@ const WalletBalance = (props: Props) => { onClick={() => doOpenModal(MODALS.WALLET_SEND)} /> - {(otherCount > WALLET_CONSOLIDATE_UTXOS || pendingUtxoConsolidating.length || consolidatingUtxos) && ( + {(otherCount > WALLET_CONSOLIDATE_UTXOS || consolidateIsPending || consolidatingUtxos) && (

{