@@ -101,19 +101,6 @@ export const FeedList = ({
101101 const [ selectedFeedCategories , setSelectedFeedCategories ] = useQueryString ( "categories" , [ ] )
102102 const [ currentPage , setCurrentPage ] = useQueryString ( "page" , "1" )
103103
104- // Update URL when network changes
105- const updateNetworkInURL = ( network : string ) => {
106- if ( typeof window === "undefined" ) return
107-
108- const params = new URLSearchParams ( window . location . search )
109- params . set ( "network" , network )
110- // Preserve the hash fragment if it exists
111- const hashFragment = window . location . hash
112- const newUrl = window . location . pathname + "?" + params . toString ( ) + hashFragment
113- window . history . replaceState ( { path : newUrl } , "" , newUrl )
114- setCurrentNetwork ( network )
115- }
116-
117104 // Initialize all other states
118105 const [ showCategoriesDropdown , setShowCategoriesDropdown ] = useState < boolean > ( false )
119106 const [ showExtraDetails , setShowExtraDetails ] = useState ( false )
@@ -170,7 +157,12 @@ export const FeedList = ({
170157 // Network selection handler
171158 function handleNetworkSelect ( chain : Chain ) {
172159 if ( ! isStreams ) {
173- updateNetworkInURL ( chain . page )
160+ const params = new URLSearchParams ( window . location . search )
161+ params . set ( "network" , chain . page )
162+ // Remove hash fragment when changing networks to avoid mismatched anchors
163+ const newUrl = window . location . pathname + "?" + params . toString ( )
164+ window . history . replaceState ( { path : newUrl } , "" , newUrl )
165+ setCurrentNetwork ( chain . page )
174166 }
175167 setSearchValue ( "" )
176168 setSelectedFeedCategories ( [ ] )
0 commit comments