Fix GitHub Authentication reload dialog appearing unnecessarily in remote tunnel scenarios (#261257)

This commit is contained in:
Copilot
2025-08-12 09:47:23 -07:00
committed by GitHub
parent ce2b14bee7
commit 97bc9a439c
@@ -81,18 +81,23 @@ export function activate(context: vscode.ExtensionContext) {
}));
// Listener to prompt for reload when the fetch implementation setting changes
let beforeFetchSetting = vscode.workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch');
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration('github-authentication.useElectronFetch')) {
const selection = await vscode.window.showInformationMessage(
vscode.l10n.t('GitHub Authentication - Reload required'),
{
modal: true,
detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.')
},
vscode.l10n.t('Reload Window')
);
if (selection) {
await vscode.commands.executeCommand('workbench.action.reloadWindow');
const afterFetchSetting = vscode.workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch');
if (beforeFetchSetting !== afterFetchSetting) {
beforeFetchSetting = afterFetchSetting;
const selection = await vscode.window.showInformationMessage(
vscode.l10n.t('GitHub Authentication - Reload required'),
{
modal: true,
detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.')
},
vscode.l10n.t('Reload Window')
);
if (selection) {
await vscode.commands.executeCommand('workbench.action.reloadWindow');
}
}
}
}));