diff --git a/ui/component/walletFiatAccountHistory/view.jsx b/ui/component/walletFiatAccountHistory/view.jsx index bd7447b69..bc8b2219a 100644 --- a/ui/component/walletFiatAccountHistory/view.jsx +++ b/ui/component/walletFiatAccountHistory/view.jsx @@ -34,24 +34,9 @@ type Props = { transactions: any, }; -export const WALLET_CONSOLIDATE_UTXOS = 400; -const LARGE_WALLET_BALANCE = 100; - const WalletBalance = (props: Props) => { const { - balance, - claimsBalance, - supportsBalance, - tipsBalance, - doOpenModal, - hasSynced, - doUtxoConsolidate, - doFetchUtxoCounts, - consolidatingUtxos, - consolidateIsPending, - massClaimingTips, - massClaimIsPending, - utxoCounts, + } = props; // receive transactions from parent component @@ -65,19 +50,6 @@ const WalletBalance = (props: Props) => { const [detailsExpanded, setDetailsExpanded] = React.useState(false); const [accountStatusResponse, setAccountStatusResponse] = React.useState(); - - 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 && detailsExpanded) { - doFetchUtxoCounts(); - } - }, [doFetchUtxoCounts, balance, detailsExpanded]); - var environment = 'test'; function getAccountStatus(){ diff --git a/ui/component/walletFiatPaymentHistory/view.jsx b/ui/component/walletFiatPaymentHistory/view.jsx index 33d30a500..0e13e366c 100644 --- a/ui/component/walletFiatPaymentHistory/view.jsx +++ b/ui/component/walletFiatPaymentHistory/view.jsx @@ -15,21 +15,6 @@ import { Lbryio } from 'lbryinc'; import moment from 'moment'; type Props = { - balance: number, - totalBalance: number, - claimsBalance: number, - supportsBalance: number, - tipsBalance: number, - doOpenModal: (string) => void, - hasSynced: boolean, - doFetchUtxoCounts: () => void, - doUtxoConsolidate: () => void, - fetchingUtxoCounts: boolean, - consolidatingUtxos: boolean, - consolidateIsPending: boolean, - massClaimingTips: boolean, - massClaimIsPending: boolean, - utxoCounts: { [string]: number }, accountDetails: any, transactions: any, totalTippedAmount: number, @@ -43,6 +28,9 @@ const WalletBalance = (props: Props) => { // receive transactions from parent component let accountTransactions = props.transactions; + console.log('heres transactions') + console.log(accountTransactions); + // let totalTippedAmount = props.totalTippedAmount; // totalTippedAmount = 0; @@ -88,34 +76,38 @@ const WalletBalance = (props: Props) => { React.useEffect(() => { (async function(){ - let response = await getPaymentHistory(); + let response = accountTransactions; - const customerStatusResponse = await getCustomerStatus(); + console.log('payment transactions'); + console.log(response); - let totalTippedAmount = 0; + const customerStatusResponse = await getCustomerStatus(); - for(const transaction of response){ - totalTippedAmount = totalTippedAmount + transaction.tipped_amount - } + let totalTippedAmount = 0; - setTotalTippedAmount(totalTippedAmount / 100); + for(const transaction of response){ + totalTippedAmount = totalTippedAmount + transaction.tipped_amount + } - setLastFour(customerStatusResponse.PaymentMethods[0].card.last4); + setTotalTippedAmount(totalTippedAmount / 100); - if (response.length > 10) response.length = 10; + setLastFour(customerStatusResponse.PaymentMethods[0].card.last4); - setPaymentHistoryTransactions(response); + if (response.length > 10) response.length = 10; - const subscriptions = [...response]; + setPaymentHistoryTransactions(response); - if(subscriptions.length > 2){ - subscriptions.length = 2 - setSubscriptions([]) - } else { - setSubscriptions([]) - } + const subscriptions = [...response]; + + if(subscriptions.length > 2){ + subscriptions.length = 2 + setSubscriptions([]) + } else { + setSubscriptions([]) + } + + console.log(response); - console.log(response); })(); }, []); @@ -139,8 +131,8 @@ const WalletBalance = (props: Props) => {
- {paymentHistoryTransactions && - paymentHistoryTransactions.reverse().map((transaction) => ( + {accountTransactions && + accountTransactions.map((transaction) => (