22
33import Image from "next/image" ;
44import { useState , useEffect , Suspense } from "react" ;
5- import { useRouter , useSearchParams } from "next/navigation" ;
5+ import { useSearchParams } from "next/navigation" ;
66import { anthropicServers , officialServers , camelServers , communityServers } from "@/public/servers" ;
77import {
88 Card ,
@@ -169,7 +169,6 @@ function Modal({ server, onClose }: ModalProps) {
169169}
170170
171171function HomeContent ( ) {
172- const router = useRouter ( ) ;
173172 const searchParams = useSearchParams ( ) ;
174173 const [ selectedServer , setSelectedServer ] = useState < Server | null > ( null ) ;
175174 const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
@@ -188,16 +187,18 @@ function HomeContent() {
188187 const handleFilterChange = ( newFilter : 'all' | 'official' | 'anthropic' | 'camel' | 'community' ) => {
189188 setFilter ( newFilter ) ;
190189
191- // Update URL search params without navigation
192- const params = new URLSearchParams ( searchParams ) ;
190+ // Use browser History API directly
191+ const params = new URLSearchParams ( window . location . search ) ;
193192 if ( newFilter === 'all' ) {
194193 params . delete ( 'filter' ) ;
195194 } else {
196195 params . set ( 'filter' , newFilter ) ;
197196 }
198197
199198 const newUrl = params . toString ( ) ? `/?${ params . toString ( ) } ` : '/' ;
200- router . replace ( newUrl , { scroll : false } ) ;
199+
200+ // Use History API instead of Next.js router
201+ window . history . replaceState ( { } , '' , newUrl ) ;
201202 } ;
202203
203204 const handleCardClick = ( server : Server ) => {
0 commit comments