File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
packages/cloud/src/bridge Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,19 @@ export class BridgeOrchestrator {
6161 public static async connectOrDisconnect (
6262 userInfo : CloudUserInfo | null ,
6363 remoteControlEnabled : boolean | undefined ,
64- options : BridgeOrchestratorOptions ,
64+ options ? : BridgeOrchestratorOptions ,
6565 ) : Promise < void > {
6666 const isEnabled = BridgeOrchestrator . isEnabled ( userInfo , remoteControlEnabled )
6767 const instance = BridgeOrchestrator . instance
6868
6969 if ( isEnabled ) {
7070 if ( ! instance ) {
71+ if ( ! options ) {
72+ console . error (
73+ `[BridgeOrchestrator#connectOrDisconnect] Cannot connect: options are required for connection` ,
74+ )
75+ return
76+ }
7177 try {
7278 console . log ( `[BridgeOrchestrator#connectOrDisconnect] Connecting...` )
7379 BridgeOrchestrator . instance = new BridgeOrchestrator ( options )
Original file line number Diff line number Diff line change @@ -135,14 +135,9 @@ export async function activate(context: vscode.ExtensionContext) {
135135 if ( data . state === "logged-out" ) {
136136 try {
137137 // Disconnect the bridge when user logs out
138- // Pass null userInfo and false for remoteControlEnabled to trigger disconnection
139- await BridgeOrchestrator . connectOrDisconnect ( null , false , {
140- userId : "" ,
141- socketBridgeUrl : "" ,
142- token : "" ,
143- provider,
144- sessionId : vscode . env . sessionId ,
145- } )
138+ // When userInfo is null and remoteControlEnabled is false, BridgeOrchestrator
139+ // will disconnect. The options parameter is not needed for disconnection.
140+ await BridgeOrchestrator . connectOrDisconnect ( null , false )
146141
147142 cloudLogger ( "[CloudService] BridgeOrchestrator disconnected on logout" )
148143 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments