Skip to content

Commit 7690da7

Browse files
mirceahaseganrhyslbw
authored andcommitted
fix(extension): tx history limit 10 and input resolution timeout increase (#1666)
1 parent 0dece94 commit 7690da7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

apps/browser-extension-wallet/src/stores/slices/wallet-activities-slice.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ const mapWalletActivities = memoize(
140140
Pick<IBlockchainProvider, 'inputResolver'> &
141141
Pick<WalletInfoSlice, 'isSharedWallet'>
142142
) => {
143+
const TX_LIMIT_SIZE = 10;
144+
const txHistorySlice = transactions.history.slice(-TX_LIMIT_SIZE);
143145
const epochRewardsMapper = (earnedEpoch: Wallet.Cardano.EpochNo, rewards: Reward[]): ExtendedActivityProps => {
144146
const REWARD_SPENDABLE_DELAY_EPOCHS = 2;
145147
const spendableEpoch = (earnedEpoch + REWARD_SPENDABLE_DELAY_EPOCHS) as Wallet.Cardano.EpochNo;
@@ -276,8 +278,8 @@ const mapWalletActivities = memoize(
276278
const getHistoricalTransactions = async () => {
277279
const filtered =
278280
!assetDetails || assetDetails?.id === cardanoCoin.id
279-
? transactions.history.map((tx) => ({ tx }))
280-
: await filterTransactionByAssetId(transactions.history);
281+
? txHistorySlice.map((tx) => ({ tx }))
282+
: await filterTransactionByAssetId(txHistorySlice);
281283
return flatten(await Promise.all(filtered.map((tx) => historicTransactionMapper(tx))));
282284
};
283285

apps/browser-extension-wallet/src/views/browser-view/features/activity/helpers/common-tx-transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { hasPhase2ValidationFailed } from '@src/utils/phase2-validation';
1414
import { createTxInspector, Milliseconds, transactionSummaryInspector } from '@cardano-sdk/core';
1515

1616
// eslint-disable-next-line no-magic-numbers
17-
const TIMEOUT = 1000 as Milliseconds;
17+
const TIMEOUT = 2000 as Milliseconds;
1818

1919
export interface TxTransformerInput {
2020
tx: Wallet.TxInFlight | Wallet.Cardano.HydratedTx | Wallet.KeyManagement.WitnessedTx;

0 commit comments

Comments
 (0)