Skip to content

Commit bdb3c80

Browse files
authored
fix: remount live slot page on network change (#288)
Add network-based key to SlotPlayerProvider to force component remount when the network changes. This ensures the live slot page fetches fresh data for the newly selected network rather than attempting to update existing state in place.
1 parent f4e004c commit bdb3c80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/routes/ethereum/live.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ import type { JSX } from 'react';
22
import { createFileRoute } from '@tanstack/react-router';
33
import { IndexPage } from '@/pages/ethereum/live';
44
import { SlotPlayerProvider } from '@/providers/SlotPlayerProvider';
5+
import { useNetwork } from '@/hooks/useNetwork';
56

67
function LivePage(): JSX.Element {
8+
const { currentNetwork } = useNetwork();
9+
10+
// Force remount when network changes to get fresh data for the new network
711
return (
812
<SlotPlayerProvider
13+
key={currentNetwork?.name}
914
tables={['fct_block_head', 'fct_block_first_seen_by_node', 'fct_attestation_first_seen_chunked_50ms']}
1015
initialPlaying={true}
1116
>

0 commit comments

Comments
 (0)