From d249fa7b95f1dd5f671de8fdec68f78e33fda363 Mon Sep 17 00:00:00 2001 From: Gustavo Silva Date: Tue, 25 Feb 2025 23:39:00 +0000 Subject: [PATCH] fix(30371): refresh activity page (#30571) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Fix Issue #30371 , where refreshing the activity page would throw an error [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30373?quickstart=1) ## **Related issues** Fixes: #30371 #30366 ## **Manual testing steps** 1. Create a bridge between two tokens from different chains 2. Go to the activity page and click on the bridge transaction details 3. refresh the page ## **Screenshots/Recordings** ### **Before** https://github.com/user-attachments/assets/5dd7eda1-30f1-41f5-90bc-c0a4d2d74d74 ### **After** https://github.com/user-attachments/assets/d14c402e-ac0d-4c36-8535-d02bf89645df ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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. --- .../transaction-details.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ui/pages/bridge/transaction-details/transaction-details.tsx b/ui/pages/bridge/transaction-details/transaction-details.tsx index cea276dbad1e..638f8635c7ce 100644 --- a/ui/pages/bridge/transaction-details/transaction-details.tsx +++ b/ui/pages/bridge/transaction-details/transaction-details.tsx @@ -174,10 +174,10 @@ const CrossChainSwapTxDetails = () => { getNetworkConfigurationsByChainId, ); - const { transactionGroup, isEarliestNonce } = location.state as { - transactionGroup: TransactionGroup; - isEarliestNonce: boolean; - }; + const transactionGroup: TransactionGroup | null = + location.state?.transactionGroup || null; + const isEarliestNonce: boolean | null = + location.state?.isEarliestNonce || null; const srcChainTxMeta = selectedAddressTxList.find( (tx) => tx.id === srcTxMetaId, ); @@ -457,12 +457,13 @@ const CrossChainSwapTxDetails = () => { : undefined } /> - - + {transactionGroup && typeof isEarliestNonce !== 'undefined' && ( + + )}