File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
console-ui/src/pages/Download Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export function Download() {
8282 const activeTab = searchParams . get ( "tab" ) || "p2p" ;
8383
8484 const heliaClientRef = useRef < HeliaClient | null > ( null ) ;
85+ const prevNetworkId = useRef ( network . id ) ;
8586
8687 // Cleanup on unmount
8788 useEffect ( ( ) => {
@@ -90,8 +91,14 @@ export function Download() {
9091 } ;
9192 } , [ ] ) ;
9293
93- // Reset everything when network changes
94+ // Reset everything when network actually changes (skip on mount so we
95+ // preserve the CID from URL query params; works with StrictMode)
9496 useEffect ( ( ) => {
97+ if ( prevNetworkId . current === network . id ) {
98+ return ;
99+ }
100+ prevNetworkId . current = network . id ;
101+
95102 heliaClientRef . current ?. stop ( ) ;
96103 heliaClientRef . current = null ;
97104
You can’t perform that action at this time.
0 commit comments