Skip to content

Commit 97bc9a4

Browse files
authored
Fix GitHub Authentication reload dialog appearing unnecessarily in remote tunnel scenarios (microsoft#261257)
1 parent ce2b14b commit 97bc9a4

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

extensions/github-authentication/src/extension.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,23 @@ export function activate(context: vscode.ExtensionContext) {
8181
}));
8282

8383
// Listener to prompt for reload when the fetch implementation setting changes
84+
let beforeFetchSetting = vscode.workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch');
8485
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => {
8586
if (e.affectsConfiguration('github-authentication.useElectronFetch')) {
86-
const selection = await vscode.window.showInformationMessage(
87-
vscode.l10n.t('GitHub Authentication - Reload required'),
88-
{
89-
modal: true,
90-
detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.')
91-
},
92-
vscode.l10n.t('Reload Window')
93-
);
94-
if (selection) {
95-
await vscode.commands.executeCommand('workbench.action.reloadWindow');
87+
const afterFetchSetting = vscode.workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch');
88+
if (beforeFetchSetting !== afterFetchSetting) {
89+
beforeFetchSetting = afterFetchSetting;
90+
const selection = await vscode.window.showInformationMessage(
91+
vscode.l10n.t('GitHub Authentication - Reload required'),
92+
{
93+
modal: true,
94+
detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.')
95+
},
96+
vscode.l10n.t('Reload Window')
97+
);
98+
if (selection) {
99+
await vscode.commands.executeCommand('workbench.action.reloadWindow');
100+
}
96101
}
97102
}
98103
}));

0 commit comments

Comments
 (0)