File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import {
5050 getMCPServerRequestTimeout ,
5151} from "./utils/configUtils" ;
5252import { useToast } from "@/hooks/use-toast" ;
53+
5354const params = new URLSearchParams ( window . location . search ) ;
5455const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1" ;
5556
@@ -204,8 +205,13 @@ const App = () => {
204205 localStorage . setItem ( CONFIG_LOCAL_STORAGE_KEY , JSON . stringify ( config ) ) ;
205206 } , [ config ] ) ;
206207
208+ const hasProcessedRef = useRef ( false ) ;
207209 // Auto-connect if serverUrl is provided in URL params (e.g. after OAuth callback)
208210 useEffect ( ( ) => {
211+ if ( hasProcessedRef . current ) {
212+ // Only try to connect once
213+ return ;
214+ }
209215 const serverUrl = params . get ( "serverUrl" ) ;
210216 if ( serverUrl ) {
211217 setSseUrl ( serverUrl ) ;
@@ -219,6 +225,7 @@ const App = () => {
219225 title : "Success" ,
220226 description : "Successfully authenticated with OAuth" ,
221227 } ) ;
228+ hasProcessedRef . current = true ;
222229 // Connect to the server
223230 connectMcpServer ( ) ;
224231 }
You can’t perform that action at this time.
0 commit comments