Skip to content

Commit 8a67faa

Browse files
committed
feat: auto-enable EVM view when URL contains EVM tx hash
Detect EVM tx hash pattern (0x + 64 hex chars) in URL and automatically switch to EVM view mode, matching the behavior when searching by EVM hash.
1 parent 69c4b17 commit 8a67faa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/routes/transactions.$hash.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ export default function TransactionDetailPage() {
9696

9797
useEffect(() => {
9898
setMounted(true)
99-
// Auto-enable EVM view if searched by EVM hash
100-
if (searchParams.get('evm') === 'true') {
99+
// Auto-enable EVM view if searched by EVM hash or URL contains EVM hash
100+
if (searchParams.get('evm') === 'true' || (params.hash && /^0x[a-fA-F0-9]{64}$/.test(params.hash))) {
101101
setEvmView(true)
102102
}
103-
}, [searchParams])
103+
}, [searchParams, params.hash])
104104

105105
const { data: transaction, isLoading, error, refetch } = useQuery({
106106
queryKey: ['transaction', params.hash],

0 commit comments

Comments
 (0)