File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -336,26 +336,25 @@ ${jsonConfig}`,
336336 private async onActiveConnectionChanged ( ) : Promise < void > {
337337 const autoStartConfig = this . getMCPAutoStartConfig ( ) ;
338338
339+ const shouldSendMCPServerNotification =
340+ this . connectionController . getActiveConnectionId ( ) !== null &&
341+ ( autoStartConfig === 'Ask' ||
342+ autoStartConfig === null ||
343+ autoStartConfig === undefined ) ;
344+
339345 logger . info ( 'Active connection changed, should update MCP server' , {
340346 'mdb.mcp.server' : autoStartConfig ,
341347 serverStarted : ! ! this . server ,
348+ shouldSendMCPServerNotification,
342349 } ) ;
343350
344- if (
345- this . connectionController . getActiveConnectionId ( ) &&
346- ( autoStartConfig === 'Ask' ||
347- autoStartConfig === null ||
348- autoStartConfig === undefined )
349- ) {
351+ if ( shouldSendMCPServerNotification ) {
350352 await this . requestAutoStartPermission ( ) ;
351- return ;
352353 }
353354
354- if ( ! this . server ) {
355- return ;
355+ if ( this . server ) {
356+ await this . switchConnectionManagerToCurrentConnection ( ) ;
356357 }
357-
358- await this . switchConnectionManagerToCurrentConnection ( ) ;
359358 }
360359
361360 private async switchConnectionManagerToCurrentConnection ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments