Skip to content

Commit

Permalink
Merge pull request #12876 from brave/fix-txData-type-errors
Browse files Browse the repository at this point in the history
fix(wallet): txData type errors
  • Loading branch information
Douglashdaniel authored Apr 5, 2022
2 parents 81861b0 + b305ebe commit 026ab29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export const createWalletReducer = (initialState: WalletState) => {
return payload[account.address]
}).flat(1)

const filteredTransactions = newPendingTransactions?.filter((tx: BraveWallet.TransactionInfo) => tx.txStatus === BraveWallet.TransactionStatus.Unapproved) ?? []
const filteredTransactions = newPendingTransactions?.filter((tx: BraveWallet.TransactionInfo) => tx?.txStatus === BraveWallet.TransactionStatus.Unapproved) ?? []

const sortedTransactionList = sortTransactionByDate(filteredTransactions)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,13 @@ const Portfolio = (props: Props) => {
}, [accounts, transactions, selectedAssetsNetwork])

const selectedAssetTransactions = React.useMemo((): BraveWallet.TransactionInfo[] => {
const filteredTransactions = transactionsByNetwork.filter((tx) => {
return parseTransaction(tx).symbol === selectedAsset?.symbol ? tx : []
})
return sortTransactionByDate(filteredTransactions, 'descending')
if (selectedAsset) {
const filteredTransactions = transactionsByNetwork.filter((tx) => {
return parseTransaction(tx).symbol === selectedAsset?.symbol ? tx : []
})
return sortTransactionByDate(filteredTransactions, 'descending')
}
return []
}, [selectedAsset, transactionsByNetwork])

const fullAssetBalances = React.useMemo(() => {
Expand Down

0 comments on commit 026ab29

Please sign in to comment.