Skip to content

Commit 1f8be2b

Browse files
committed
Cleanup
1 parent a16185b commit 1f8be2b

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

packages/cloud/src/bridge/BridgeOrchestrator.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

src/extension.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)