Skip to content

Commit 6e619fd

Browse files
authored
fix(activity): stuck confirmation on back after tx + missing lending deposit token icon cp-8.3.0 (#33157)
## **Description** Two related Activity-redesign bug fixes on one branch. **1. Stuck confirmation on back after a transaction (TMCU-1001).** After submitting a full-screen confirmation (send, Earn pooled-staking, or stablecoin lending), the app redirects to the Activity screen. With the Money-account feature enabled, Activity is registered as a root-level screen, so the redirect pushed it on top of the still-mounted confirmation — whose approval had already been consumed (`deleteAfterResult`). Pressing back returned to that consumed confirmation, which rendered an infinite loader/skeleton. The fix adds a shared `navigateToActivityAfterConfirmation` helper that replaces the confirmation's stack with Activity in a single `StackActions.replace`, removing the stale confirmation from the back stack. It's wired into the shared transaction confirm hook (`useTransactionConfirm`), batch approvals (`useConfirmActions`), the Earn lending deposit/withdrawal views, and the legacy staking footer. Approach note : I first tried to make "back" return to the transaction **build** screen (amount / recipient / input). On a native-stack that means removing the nested confirmation while pushing a root-level Activity — two screen changes that react-native-screens animates at the same time, producing a double-navigation on the way in and a flashing half-finished pop on the way back. After several attempts to work around the animation, the reliable single-transition solution was to replace the confirmation's whole stack. As a result: **send/staking → back returns to Wallet home**; **lending → back returns to the input screen** (its input lives in a separate stack that survives the replace). **2. Missing token icon/amount on lending deposit rows (TMCU-1082).** Lending deposit Activity rows derived their token from the pool contract (`txParams.to`) instead of the underlying deposited asset, so the row had no resolvable icon, symbol, or amount. The supplied token is now resolved from simulation data / the outgoing Transfer log (falling back to the pool address), and lending token metadata is enriched from the tokens API; the row avatar uses the resolved token. ## **Changelog** CHANGELOG entry: Fixed the Activity screen back button returning to a stuck confirmation screen after a transaction, and fixed the missing token icon and amount on Earn lending deposit rows. ## **Related issues** Fixes: [TMCU-1001](https://consensyssoftware.atlassian.net/browse/TMCU-1001) Fixes: [TMCU-1082](https://consensyssoftware.atlassian.net/browse/TMCU-1082) ## **Manual testing steps** ```gherkin Feature: Activity navigation after a transaction Background: Given the Money-account and Activity-redesign feature flags are enabled Scenario: Back after a send or staking transaction is not stuck Given I complete a native/ERC-20/NFT send, or an ETH pooled-staking deposit/unstake/claim When I am redirected to the Activity screen and tap the back button Then I return to Wallet home And I never land on the consumed confirmation screen or an infinite loader Scenario: Back after a lending deposit returns to the input screen Given I complete a stablecoin (USDC/USDT/DAI) lending deposit or withdrawal When I am redirected to the Activity screen and tap the back button Then I return to the lending input screen And I never land on the consumed confirmation screen Feature: Lending deposit Activity row Scenario: Lending deposit row shows the deposited token Given I complete a stablecoin lending deposit When I open the Activity list Then the lending deposit row shows the underlying token's icon, symbol, and amount ``` Also covered by automated tests: real-navigator integration tests for all three navigation flows (`navigateToActivityAfterConfirmation.test.tsx`), the redirect call sites, and the lending row/adapter changes (`ActivityListItemRow`, `local-transaction`). ## **Screenshots/Recordings** **Staking Before** https://github.com/user-attachments/assets/b3fd9f9e-21a7-4614-a87d-911f1073bad1 **Staking After** https://github.com/user-attachments/assets/7e5ce1e1-bfd1-4d25-9eba-122b572b6848 **NFT Send Before** https://github.com/user-attachments/assets/dbe4f6c3-24aa-4c57-b687-277cb85bfbfa **NFT Send After** https://github.com/user-attachments/assets/3d84d448-9560-4496-acf5-eca162faaec1 **Native Send Before** https://github.com/user-attachments/assets/c22c9f64-9e32-44b9-8103-ade68a099aa9 **Native Send After** https://github.com/user-attachments/assets/04a8b1fe-6355-442e-8b3a-f4b9623fc491 **Send Before** https://github.com/user-attachments/assets/43e326cf-58ab-422a-b08d-db67cf3d5784 **Send After** https://github.com/user-attachments/assets/a19740a6-bf2c-4217-bd68-aebcd5392820 **Lending Icon Fix Before** https://github.com/user-attachments/assets/9495b417-ea9a-42ec-aa5d-de382a002cfb **Lending Icon Fix After** https://github.com/user-attachments/assets/cf31532e-acb8-4bd8-bda9-ec48ec7c2a88 ### **Before** `~` ### **After** `~` ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - [ ] I've tested with a power user scenario - [ ] I've instrumented key operations with Sentry traces for production performance metrics ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [TMCU-1001]: https://consensyssoftware.atlassian.net/browse/TMCU-1001?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Navigation stack replacement affects multiple confirmation flows; lending adapter heuristics could mis-identify tokens on unusual receipt shapes, though fallbacks and tests cover main paths. > > **Overview** > Fixes two Activity-redesign issues: **post-transaction back navigation** and **lending deposit row/details display**. > > **Post-tx navigation:** Adds `navigateToActivityAfterConfirmation`, which uses root `StackActions.replace` for Activity when `TRANSACTIONS_VIEW` is on the root stack (Money-account on), instead of pushing Activity on top of a consumed confirmation. Falls back to plain `navigate` otherwise. Wired through `useTransactionConfirm`, `useConfirmActions`, Earn lending confirm views, and staking footer. > > **Lending token display:** `local-transaction` now resolves lending deposit `sourceToken` from simulation balance decreases or user outgoing ERC-20 transfers (pool or aToken recipient), not `txParams.to`. New `enrichTokenFromApi` fills symbol/decimals from the tokens API for lending rows (`useActivityListItemRowContent`), avatars, and `SwapDetails` amount headers when adapters only supply atomic amounts + `assetId`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 212f871. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 28a2264 commit 6e619fd

16 files changed

Lines changed: 959 additions & 29 deletions

File tree

app/components/UI/ActivityListItemRow/ActivityListItemRow.test.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,64 @@ describe('ActivityListItemRow — row content', () => {
11531153
jest.mocked(useTokensData).mockReturnValue({});
11541154
});
11551155

1156+
it('resolves a lending-deposit token symbol/decimals from the tokens API and scales the amount', () => {
1157+
const assetId =
1158+
'eip155:42161/erc20:0x0000000000000000000000000000000000000002';
1159+
jest.mocked(useTokensData).mockReturnValue({
1160+
[assetId]: {
1161+
assetId,
1162+
symbol: 'USDT',
1163+
decimals: 6,
1164+
name: 'Tether USD',
1165+
iconUrl: '',
1166+
},
1167+
});
1168+
1169+
// The adapter carries only the atomic amount + asset id (the tx targets the
1170+
// pool, so symbol/decimals aren't in local metadata). Without decimals the
1171+
// amount would render unscaled (10,000 instead of 0.01).
1172+
const item = makeItem({
1173+
type: 'lendingDeposit',
1174+
status: 'success',
1175+
chainId: 'eip155:42161',
1176+
sourceToken: { amount: '10000', direction: 'out', assetId },
1177+
});
1178+
1179+
const { getByTestId } = render(
1180+
<ActivityListItemRow item={item} index={0} />,
1181+
);
1182+
1183+
expect(getByTestId('activity-primary-amount-0xabc').props.children).toBe(
1184+
'-0.01 USDT',
1185+
);
1186+
expect(getByTestId('avatar-token-USDT')).toBeOnTheScreen();
1187+
1188+
jest.mocked(useTokensData).mockReturnValue({});
1189+
});
1190+
1191+
it('renders a lending-deposit amount from adapter-provided decimals without an API lookup', () => {
1192+
// When the adapter already resolved symbol/decimals, the row scales the
1193+
// amount without depending on the tokens API (which returns nothing here).
1194+
const item = makeItem({
1195+
type: 'lendingDeposit',
1196+
status: 'success',
1197+
sourceToken: {
1198+
amount: '10000',
1199+
decimals: 6,
1200+
symbol: 'USDC',
1201+
direction: 'out',
1202+
},
1203+
});
1204+
1205+
const { getByTestId } = render(
1206+
<ActivityListItemRow item={item} index={0} />,
1207+
);
1208+
1209+
expect(getByTestId('activity-primary-amount-0xabc').props.children).toBe(
1210+
'-0.01 USDC',
1211+
);
1212+
});
1213+
11561214
it('renders cross-token bridge as swapped with token pair subtitle', () => {
11571215
const item = makeItem({
11581216
type: 'bridge',

app/components/UI/ActivityListItemRow/useActivityListItemRowContent.ts

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
applyDisplaySign,
2626
type ActivityKind,
2727
type ActivityListItem,
28+
enrichTokenFromApi,
2829
getDisplaySignPrefix,
2930
getHumanReadableTokenAmount,
3031
isFailedOrCancelledTransfer,
@@ -1135,17 +1136,45 @@ export function useActivityListItemRowContent(
11351136
)
11361137
: undefined;
11371138

1139+
const isLending =
1140+
item.type === 'lendingDeposit' || item.type === 'lendingWithdrawal';
1141+
const lendingAssetIds: string[] = [];
1142+
if (isLending) {
1143+
if (
1144+
'destinationToken' in item.data &&
1145+
item.data.destinationToken?.assetId
1146+
) {
1147+
lendingAssetIds.push(item.data.destinationToken.assetId);
1148+
}
1149+
if ('sourceToken' in item.data && item.data.sourceToken?.assetId) {
1150+
lendingAssetIds.push(item.data.sourceToken.assetId);
1151+
}
1152+
}
1153+
const lendingTokenData = useTokensData(lendingAssetIds);
1154+
11381155
const content = resolveCoreContent(item, bridgeHistoryItem);
1156+
1157+
let basePrimaryToken: TokenAmount | undefined;
1158+
if (isSpendingCap) {
1159+
basePrimaryToken = spendingCapToken?.amount ? spendingCapToken : undefined;
1160+
} else if (isLending) {
1161+
basePrimaryToken = enrichTokenFromApi(
1162+
content.primaryToken,
1163+
lendingTokenData,
1164+
);
1165+
} else {
1166+
basePrimaryToken = content.primaryToken;
1167+
}
11391168
const primaryToken = enrichStablecoinTokenMetadata(
1140-
isSpendingCap
1141-
? spendingCapToken?.amount
1142-
? spendingCapToken
1143-
: undefined
1144-
: content.primaryToken,
1169+
basePrimaryToken,
11451170
networkChainId,
11461171
);
1172+
1173+
const baseSecondaryToken = isLending
1174+
? enrichTokenFromApi(content.secondaryToken, lendingTokenData)
1175+
: content.secondaryToken;
11471176
const secondaryToken = enrichStablecoinTokenMetadata(
1148-
content.secondaryToken,
1177+
baseSecondaryToken,
11491178
networkChainId,
11501179
);
11511180
const isPerpsFunding = isPerpsFundingKind(item.type);
@@ -1225,12 +1254,18 @@ export function useActivityListItemRowContent(
12251254
? getPredictActivity(item)?.icon
12261255
: undefined;
12271256

1257+
let avatarTokens: TokenAmount[];
1258+
if (isSpendingCap && spendingCapToken) {
1259+
avatarTokens = [spendingCapToken];
1260+
} else if (isLending && primaryToken) {
1261+
avatarTokens = [primaryToken];
1262+
} else {
1263+
avatarTokens = resolveAvatarTokens(item, bridgeHistoryItem);
1264+
}
1265+
12281266
return {
12291267
...content,
1230-
avatarTokens:
1231-
isSpendingCap && spendingCapToken
1232-
? [spendingCapToken]
1233-
: resolveAvatarTokens(item, bridgeHistoryItem),
1268+
avatarTokens,
12341269
avatarIconUrl: predictIconUrl,
12351270
perpsMarketSymbol,
12361271
primaryToken,

app/components/UI/Earn/Views/EarnLendingDepositConfirmationView/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
1010
import { ScrollView, View } from 'react-native';
1111
import { useSelector } from 'react-redux';
1212
import { strings } from '../../../../../../locales/i18n';
13-
import Routes from '../../../../../constants/navigation/Routes';
13+
import { navigateToActivityAfterConfirmation } from '../../../../../util/navigation/navigateToActivityAfterConfirmation';
1414
import Engine from '../../../../../core/Engine';
1515
import { selectSelectedInternalAccountByScope } from '../../../../../selectors/multichainAccounts/accounts';
1616
import { selectCurrentCurrency } from '../../../../../selectors/currencyRateController';
@@ -415,7 +415,7 @@ const EarnLendingDepositConfirmationView = () => {
415415
});
416416
// There is variance in when navigation can be called across chains
417417
setTimeout(() => {
418-
navigation.navigate(Routes.TRANSACTIONS_VIEW);
418+
navigateToActivityAfterConfirmation(navigation);
419419
}, 0);
420420
},
421421
({ transactionMeta }) => transactionMeta.id === transactionId,

app/components/UI/Earn/Views/EarnLendingWithdrawalConfirmationView/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Badge, {
2020
import Text, {
2121
TextVariant,
2222
} from '../../../../../component-library/components/Texts/Text';
23-
import Routes from '../../../../../constants/navigation/Routes';
23+
import { navigateToActivityAfterConfirmation } from '../../../../../util/navigation/navigateToActivityAfterConfirmation';
2424
import {
2525
IMetaMetricsEvent,
2626
MetaMetricsEvents,
@@ -316,7 +316,7 @@ const EarnLendingWithdrawalConfirmationView = () => {
316316
});
317317
// There is variance in when navigation can be called across chains
318318
setTimeout(() => {
319-
navigation.navigate(Routes.TRANSACTIONS_VIEW);
319+
navigateToActivityAfterConfirmation(navigation);
320320
}, 0);
321321
},
322322
({ transactionMeta }) => transactionMeta.id === transactionId,

app/components/UI/Stake/components/StakingConfirmation/ConfirmationFooter/FooterButtonGroup/FooterButtonGroup.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
FooterButtonGroupActions,
2323
FooterButtonGroupProps,
2424
} from './FooterButtonGroup.types';
25-
import Routes from '../../../../../../../constants/navigation/Routes';
25+
import { navigateToActivityAfterConfirmation } from '../../../../../../../util/navigation/navigateToActivityAfterConfirmation';
2626
import usePoolStakedUnstake from '../../../../hooks/usePoolStakedUnstake';
2727
import { useAnalytics } from '../../../../../../hooks/useAnalytics/useAnalytics';
2828
import {
@@ -59,7 +59,6 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
5959
const { styles } = useStyles(styleSheet, {});
6060

6161
const navigation = useNavigation();
62-
const { navigate } = navigation;
6362

6463
const { trackEvent, createEventBuilder } = useAnalytics();
6564

@@ -117,7 +116,7 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
117116
() => {
118117
submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].SUBMITTED);
119118
setDidSubmitTransaction(false);
120-
navigate(Routes.TRANSACTIONS_VIEW);
119+
navigateToActivityAfterConfirmation(navigation);
121120
},
122121
({ transactionMeta }) => transactionMeta.id === transactionId,
123122
);
@@ -148,7 +147,7 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
148147
(transactionMeta) => transactionMeta.id === transactionId,
149148
);
150149
},
151-
[action, navigate, submitTxMetaMetric],
150+
[action, navigation, submitTxMetaMetric],
152151
);
153152

154153
const handleConfirmation = async () => {
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import React from 'react';
2+
import { render } from '@testing-library/react-native';
3+
import type {
4+
ActivityListItem,
5+
TokenAmount,
6+
} from '../../../../util/activity-adapters';
7+
import { useTokensData } from '../../../hooks/useTokensData/useTokensData';
8+
import { SwapDetails } from './SwapDetails';
9+
10+
// Capture the token the amount header receives so we can assert it was enriched
11+
// with decimals before formatting.
12+
let capturedSentToken: TokenAmount | undefined;
13+
14+
jest.mock('../../../hooks/useTokensData/useTokensData', () => ({
15+
useTokensData: jest.fn(() => ({})),
16+
}));
17+
18+
jest.mock('../components', () => ({
19+
ActivityDetailsBlockExplorerButton: () => null,
20+
ActivityDetailsDoItAgainButton: () => null,
21+
ActivityDetailsFooter: () => null,
22+
ActivityDetailsMetadata: () => null,
23+
ActivityDetailsFeesAndTotal: () => null,
24+
ActivityDetailsDualAmountHeader: ({
25+
sentToken,
26+
}: {
27+
sentToken?: TokenAmount;
28+
}) => {
29+
capturedSentToken = sentToken;
30+
return null;
31+
},
32+
}));
33+
34+
jest.mock('../hooks/useActivityDetailsDoItAgain', () => ({
35+
useActivityDetailsDoItAgain: () => jest.fn(),
36+
canRenderActivityDetailsDoItAgain: () => false,
37+
}));
38+
39+
const USDT_ASSET_ID =
40+
'eip155:42161/erc20:0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9';
41+
42+
const makeLendingDepositItem = (
43+
sourceToken: Partial<TokenAmount>,
44+
): ActivityListItem =>
45+
({
46+
type: 'lendingDeposit',
47+
chainId: 'eip155:42161',
48+
status: 'success',
49+
timestamp: 1,
50+
hash: '0xabc',
51+
data: { sourceToken },
52+
}) as unknown as ActivityListItem;
53+
54+
describe('SwapDetails', () => {
55+
beforeEach(() => {
56+
capturedSentToken = undefined;
57+
jest.mocked(useTokensData).mockReturnValue({});
58+
});
59+
60+
it('enriches the deposited token decimals from the tokens API so the amount is not rendered as raw base units', () => {
61+
// The adapter left `decimals` off the lending sourceToken; without
62+
// enrichment the amount header would format 10000 base units as "10,000"
63+
// instead of 0.01 USDT.
64+
jest.mocked(useTokensData).mockReturnValue({
65+
[USDT_ASSET_ID]: {
66+
assetId: USDT_ASSET_ID,
67+
symbol: 'USDT',
68+
decimals: 6,
69+
name: 'Tether USD',
70+
iconUrl: '',
71+
},
72+
});
73+
74+
render(
75+
<SwapDetails
76+
item={
77+
makeLendingDepositItem({
78+
direction: 'out',
79+
amount: '10000',
80+
assetId: USDT_ASSET_ID,
81+
}) as never
82+
}
83+
/>,
84+
);
85+
86+
expect(capturedSentToken?.decimals).toBe(6);
87+
expect(capturedSentToken?.symbol).toBe('USDT');
88+
expect(capturedSentToken?.amount).toBe('10000');
89+
});
90+
91+
it('leaves an already-populated token unchanged (no-op when decimals are present)', () => {
92+
render(
93+
<SwapDetails
94+
item={
95+
makeLendingDepositItem({
96+
direction: 'out',
97+
amount: '10000',
98+
assetId: USDT_ASSET_ID,
99+
decimals: 6,
100+
symbol: 'USDT',
101+
}) as never
102+
}
103+
/>,
104+
);
105+
106+
expect(capturedSentToken?.decimals).toBe(6);
107+
});
108+
});

app/components/Views/ActivityDetails/templates/SwapDetails.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import React from 'react';
22
import { Box, SectionDivider } from '@metamask/design-system-react-native';
3-
import type { ActivityListItem } from '../../../../util/activity-adapters';
3+
import {
4+
type ActivityListItem,
5+
enrichTokenFromApi,
6+
} from '../../../../util/activity-adapters';
7+
import { useTokensData } from '../../../hooks/useTokensData/useTokensData';
48
import {
59
ActivityDetailsBlockExplorerButton,
610
ActivityDetailsDoItAgainButton,
@@ -30,9 +34,17 @@ type SwapDetailsItem = Extract<
3034
>;
3135

3236
export function SwapDetails({ item }: { item: SwapDetailsItem }) {
33-
const { sourceToken } = item.data;
34-
const destinationToken =
37+
const rawSourceToken = item.data.sourceToken;
38+
const rawDestinationToken =
3539
'destinationToken' in item.data ? item.data.destinationToken : undefined;
40+
41+
const tokenData = useTokensData(
42+
[rawSourceToken?.assetId, rawDestinationToken?.assetId].filter(
43+
(assetId): assetId is string => Boolean(assetId),
44+
),
45+
);
46+
const sourceToken = enrichTokenFromApi(rawSourceToken, tokenData);
47+
const destinationToken = enrichTokenFromApi(rawDestinationToken, tokenData);
3648
const totalToken = sourceToken?.amount ? sourceToken : destinationToken;
3749
const handleDoItAgain = useActivityDetailsDoItAgain({
3850
sourceToken,

app/components/Views/confirmations/hooks/transactions/useTransactionConfirm.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { useGaslessSupportedSmartTransactions } from '../gas/useGaslessSupported
2626
import { cloneDeep } from 'lodash';
2727
import { useTransactionPayQuotes } from '../pay/useTransactionPayData';
2828
import { useMusdConfirmNavigation } from '../../../../UI/Earn/hooks/useMusdConfirmNavigation';
29+
import { navigateToActivityAfterConfirmation } from '../../../../../util/navigation/navigateToActivityAfterConfirmation';
2930
import { useFiatConfirm } from '../pay/useFiatConfirm';
3031
import { useHandleHwSend } from '../../../../UI/HardwareWallet/Swaps/useHandleHwSend';
3132

@@ -200,7 +201,7 @@ export function useTransactionConfirm() {
200201
isFullScreenConfirmation &&
201202
!hasTransactionType(transactionMetadata, GO_BACK_TYPES)
202203
) {
203-
navigation.navigate(Routes.TRANSACTIONS_VIEW);
204+
navigateToActivityAfterConfirmation(navigation);
204205
} else {
205206
navigation.goBack();
206207
}

app/components/Views/confirmations/hooks/useConfirmActions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TransactionType } from '@metamask/transaction-controller';
55

66
import PPOMUtil from '../../../../lib/ppom/ppom-util';
77
import Routes from '../../../../constants/navigation/Routes';
8+
import { navigateToActivityAfterConfirmation } from '../../../../util/navigation/navigateToActivityAfterConfirmation';
89
import { MetaMetricsEvents } from '../../../../core/Analytics';
910

1011
import { isSignatureRequest } from '../utils/confirm';
@@ -76,7 +77,7 @@ export const useConfirmActions = () => {
7677
});
7778

7879
if (approvalType === ApprovalType.TransactionBatch) {
79-
navigation.navigate(Routes.TRANSACTIONS_VIEW);
80+
navigateToActivityAfterConfirmation(navigation);
8081
} else {
8182
navigation.goBack();
8283
}

0 commit comments

Comments
 (0)