debug: fix auto attach not turning on if reselecting current state

Fixes https://github.com/microsoft/vscode/issues/111021
This commit is contained in:
Connor Peet 2020-12-03 22:07:19 -08:00
parent c70d984fa2
commit 63137db51c
No known key found for this signature in database
GPG Key ID: CF8FD2EA0DBC61BD

View File

@ -156,7 +156,7 @@ async function toggleAutoAttachSetting(context: vscode.ExtensionContext, scope?:
quickPick.show();
const result = await new Promise<PickResult>(resolve => {
let result = await new Promise<PickResult>(resolve => {
quickPick.onDidAccept(() => resolve(quickPick.selectedItems[0]));
quickPick.onDidHide(() => resolve(undefined));
quickPick.onDidTriggerButton(() => {
@ -179,7 +179,11 @@ async function toggleAutoAttachSetting(context: vscode.ExtensionContext, scope?:
}
if ('state' in result) {
section.update(SETTING_STATE, result.state, scope);
if (result.state !== current) {
section.update(SETTING_STATE, result.state, scope);
} else if (isTemporarilyDisabled) {
result = { setTempDisabled: false };
}
}
if ('setTempDisabled' in result) {