File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import {
50
50
getMCPServerRequestTimeout ,
51
51
} from "./utils/configUtils" ;
52
52
import { useToast } from "@/hooks/use-toast" ;
53
+
53
54
const params = new URLSearchParams ( window . location . search ) ;
54
55
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1" ;
55
56
@@ -204,8 +205,13 @@ const App = () => {
204
205
localStorage . setItem ( CONFIG_LOCAL_STORAGE_KEY , JSON . stringify ( config ) ) ;
205
206
} , [ config ] ) ;
206
207
208
+ const hasProcessedRef = useRef ( false ) ;
207
209
// Auto-connect if serverUrl is provided in URL params (e.g. after OAuth callback)
208
210
useEffect ( ( ) => {
211
+ if ( hasProcessedRef . current ) {
212
+ // Only try to connect once
213
+ return ;
214
+ }
209
215
const serverUrl = params . get ( "serverUrl" ) ;
210
216
if ( serverUrl ) {
211
217
setSseUrl ( serverUrl ) ;
@@ -219,6 +225,7 @@ const App = () => {
219
225
title : "Success" ,
220
226
description : "Successfully authenticated with OAuth" ,
221
227
} ) ;
228
+ hasProcessedRef . current = true ;
222
229
// Connect to the server
223
230
connectMcpServer ( ) ;
224
231
}
You can’t perform that action at this time.
0 commit comments