Skip to content

Commit e32d420

Browse files
committed
refactor: change block explorer source naming in UnifiedTransactionsView
1 parent 601d86b commit e32d420

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

app/components/Views/UnifiedTransactionsView/UnifiedTransactionsView.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ const UnifiedTransactionsView = ({
359359
]);
360360

361361
const hasEvmChainsEnabled = enabledEVMChainIds.length > 0;
362-
const firstBlockExplorer = useBlockExplorer(
362+
const popularListBlockExplorer = useBlockExplorer(
363363
hasEvmChainsEnabled ? enabledEVMChainIds[0] : undefined,
364364
);
365365

@@ -384,20 +384,19 @@ const UnifiedTransactionsView = ({
384384
}, [enabledEVMChainIds, evmNetworkConfigurationsByChainId]);
385385

386386
const blockExplorerUrl = useMemo(() => {
387-
// TODO: We should make sure configBlockExplorerUrl contains all blockexplorer needed
388-
// This workaround was added to fix the issue, but it's not a good solution to have to different
389-
// sources of truth for block explorer urls.
387+
// configBlockExplorerUrl contains block explorer urls only for networks added by default after fresh install
388+
// other networks should use PopularList, which is used by useBlockExplorer hook
390389
if (configBlockExplorerUrl) {
391390
return configBlockExplorerUrl;
392391
}
393392
return hasEvmChainsEnabled
394-
? firstBlockExplorer.getBlockExplorerUrl(
393+
? popularListBlockExplorer.getBlockExplorerUrl(
395394
selectedAccountGroupEvmAddress,
396395
) || undefined
397396
: undefined;
398397
}, [
399398
configBlockExplorerUrl,
400-
firstBlockExplorer,
399+
popularListBlockExplorer,
401400
selectedAccountGroupEvmAddress,
402401
hasEvmChainsEnabled,
403402
]);
@@ -429,7 +428,7 @@ const UnifiedTransactionsView = ({
429428
} else {
430429
url = blockExplorerUrl;
431430
title = hasEvmChainsEnabled
432-
? firstBlockExplorer.getBlockExplorerName(enabledEVMChainIds[0])
431+
? popularListBlockExplorer.getBlockExplorerName(enabledEVMChainIds[0])
433432
: undefined;
434433
}
435434

@@ -445,7 +444,7 @@ const UnifiedTransactionsView = ({
445444
providerType,
446445
blockExplorerUrl,
447446
selectedAccountGroupEvmAddress,
448-
firstBlockExplorer,
447+
popularListBlockExplorer,
449448
enabledEVMChainIds,
450449
configBlockExplorerUrl,
451450
hasEvmChainsEnabled,

app/util/networks/customNetworks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const PopularList = [
106106
rpcUrl: `https://palm-mainnet.infura.io/v3/${infuraProjectId}`,
107107
ticker: 'PALM',
108108
rpcPrefs: {
109-
blockExplorerUrl: 'https://explorer.palm.io',
109+
blockExplorerUrl: 'https://palm.chainlens.com',
110110
imageUrl: 'PALM',
111111
imageSource: require('../../images/palm.png'),
112112
},

0 commit comments

Comments
 (0)