Skip to content

Commit 1c83dfd

Browse files
committed
fix: address some comments
1 parent b438604 commit 1c83dfd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/pages/bridge/prepare/prepare-bridge-page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import {
8181
import { useI18nContext } from '../../../hooks/useI18nContext';
8282
import { useTokensWithFiltering } from '../../../hooks/bridge/useTokensWithFiltering';
8383
import {
84-
setActiveNetwork,
8584
setActiveNetworkWithError,
8685
setSelectedAccount,
8786
} from '../../../store/actions';
@@ -560,7 +559,7 @@ const PrepareBridgePage = () => {
560559
name: isSwap ? TraceName.SwapViewLoaded : TraceName.BridgeViewLoaded,
561560
timestamp: Date.now(),
562561
});
563-
}, [isSwap]);
562+
}, []);
564563

565564
// Set the default destination token for swaps (only when unified UI is disabled)
566565
useEffect(() => {
@@ -823,7 +822,7 @@ const PrepareBridgePage = () => {
823822
: toChain?.chainId;
824823

825824
if (networkClientId) {
826-
dispatch(setActiveNetwork(networkClientId));
825+
dispatch(setActiveNetworkWithError(networkClientId));
827826
}
828827
if (fromChain?.chainId) {
829828
dispatch(setToChainId(fromChain.chainId));
@@ -875,9 +874,10 @@ const PrepareBridgePage = () => {
875874
}
876875
}
877876
customTokenListGenerator={
878-
// TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31880
879-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
880-
toChain || isSwap ? toTokenListGenerator : undefined
877+
toChain &&
878+
(isSwapFromUrl || toChain.chainId !== fromChain?.chainId)
879+
? toTokenListGenerator
880+
: undefined
881881
}
882882
amountInFiat={
883883
// TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31880

0 commit comments

Comments
 (0)