From 28321349a7e9aca523ba1ffc4debbcf5d612d1a6 Mon Sep 17 00:00:00 2001 From: tryiou Date: Tue, 5 Dec 2023 20:21:03 +0100 Subject: [PATCH 1/2] fix for 'unspent page' + one coin selected producing call bursts. --- src/app/components/shared/transactions-panel-table.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/components/shared/transactions-panel-table.js b/src/app/components/shared/transactions-panel-table.js index 993a35b..c3295f5 100644 --- a/src/app/components/shared/transactions-panel-table.js +++ b/src/app/components/shared/transactions-panel-table.js @@ -1,7 +1,7 @@ // Copyright (c) 2020 The Blocknet developers // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -import React, {useState, useEffect} from 'react'; +import React, {useMemo, useState, useEffect} from 'react'; import PropTypes from 'prop-types'; import {Card, CardBody, CardFooter, CardHeader} from './card'; import TransactionsHeader from './transactions-panel-header'; @@ -25,7 +25,9 @@ const TransactionsPanelTable = ({ const [transactions, setTransactions] = useState([]); const walletLookup = new Map(wallets.map(t => [t.ticker, t])); - const sortedWallets = activeWallet ? [wallets.find(w => w.ticker === activeWallet)] : wallets.sort(walletSorter(balances)); + const sortedWallets = useMemo(() => activeWallet + ? [wallets.find(w => w.ticker === activeWallet)] + : wallets.sort(walletSorter(balances)), [wallets, balances, activeWallet]); // ToDo: enable Select, Label, and Date columns when available const hiddenFeature = true; From 33181311f086505c66aa5638ce64231c503bde24 Mon Sep 17 00:00:00 2001 From: tryiou Date: Tue, 5 Dec 2023 21:29:09 +0100 Subject: [PATCH 2/2] remove balances from update trigger --- src/app/components/shared/transactions-panel-table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/shared/transactions-panel-table.js b/src/app/components/shared/transactions-panel-table.js index c3295f5..f979661 100644 --- a/src/app/components/shared/transactions-panel-table.js +++ b/src/app/components/shared/transactions-panel-table.js @@ -27,7 +27,7 @@ const TransactionsPanelTable = ({ const walletLookup = new Map(wallets.map(t => [t.ticker, t])); const sortedWallets = useMemo(() => activeWallet ? [wallets.find(w => w.ticker === activeWallet)] - : wallets.sort(walletSorter(balances)), [wallets, balances, activeWallet]); + : wallets.sort(walletSorter(balances)), [wallets, activeWallet]); // ToDo: enable Select, Label, and Date columns when available const hiddenFeature = true;