Skip to content

Commit c6d3c12

Browse files
authored
fix(dev): Q developer menu opening wrong auth state #6351
It's opening the toolkit global state value instead.
1 parent 5962a67 commit c6d3c12

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/dev/activation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class ObjectEditor {
334334
return this.openState(targetContext.secrets, key)
335335
case 'auth':
336336
// Auth memento is determined in a different way
337-
return this.openState(getEnvironmentSpecificMemento(), key)
337+
return this.openState(getEnvironmentSpecificMemento(globalState), key)
338338
}
339339
}
340340

packages/core/src/shared/utilities/mementos.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ export function partition(memento: vscode.Memento, key: string): vscode.Memento
3737
* with the local globalState. We want certain functionality to be isolated to
3838
* the remote instance.
3939
*/
40-
export function getEnvironmentSpecificMemento(): vscode.Memento {
40+
export function getEnvironmentSpecificMemento(globalState?: vscode.Memento): vscode.Memento {
4141
if (!vscode.env.remoteName) {
4242
// local compute: no further partitioning
43-
return globals.globalState
43+
return globalState ?? globals.globalState
4444
}
4545

4646
const devEnvId = getCodeCatalystDevEnvId()
4747

4848
if (devEnvId !== undefined) {
4949
// dev env: partition to dev env ID (compute backend might not always be the same)
50-
return partition(globals.globalState, devEnvId)
50+
return partition(globalState ?? globals.globalState, devEnvId)
5151
}
5252

5353
// remote env: keeps a shared "global state" for all workspaces that report the same machine ID
54-
return partition(globals.globalState, globals.machineId)
54+
return partition(globalState ?? globals.globalState, globals.machineId)
5555
}

0 commit comments

Comments
 (0)