-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Disable Roomote Control on logout #7976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,13 +59,28 @@ export class BridgeOrchestrator { | |
| return BridgeOrchestrator.instance | ||
| } | ||
|
|
||
| public static isEnabled(user?: CloudUserInfo | null, remoteControlEnabled?: boolean): boolean { | ||
| return !!(user?.id && user.extensionBridgeEnabled && remoteControlEnabled) | ||
| public static isEnabled(user: CloudUserInfo | null, remoteControlEnabled: boolean): boolean { | ||
| // Always disabled if signed out. | ||
| if (!user) { | ||
| return false | ||
| } | ||
|
|
||
| // Disabled by the user's organization? | ||
| if (!user.extensionBridgeEnabled) { | ||
| return false | ||
| } | ||
|
|
||
| // Disabled by the user? | ||
| if (!remoteControlEnabled) { | ||
| return false | ||
| } | ||
|
|
||
| return true | ||
| } | ||
|
|
||
| public static async connectOrDisconnect( | ||
| userInfo: CloudUserInfo | null, | ||
| remoteControlEnabled: boolean | undefined, | ||
| userInfo: CloudUserInfo, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intentional? The connectOrDisconnect() method now requires a non-null userInfo parameter, but it's being called from ClineProvider.remoteControlEnabled() where userInfo could be null. This type mismatch could lead to runtime errors. Consider either:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no type mismatches; the build would fail otherwise. |
||
| remoteControlEnabled: boolean, | ||
| options: BridgeOrchestratorOptions, | ||
| ): Promise<void> { | ||
| if (BridgeOrchestrator.isEnabled(userInfo, remoteControlEnabled)) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.