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 // 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 => { context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration('github-authentication.useElectronFetch')) { if (e.affectsConfiguration('github-authentication.useElectronFetch')) {
const selection = await vscode.window.showInformationMessage( const afterFetchSetting = vscode.workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch');
vscode.l10n.t('GitHub Authentication - Reload required'), if (beforeFetchSetting !== afterFetchSetting) {
{ beforeFetchSetting = afterFetchSetting;
modal: true, const selection = await vscode.window.showInformationMessage(
detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.') vscode.l10n.t('GitHub Authentication - Reload required'),
}, {
vscode.l10n.t('Reload Window') modal: true,
); detail: vscode.l10n.t('A reload is required for the fetch setting change to take effect.')
if (selection) { },
await vscode.commands.executeCommand('workbench.action.reloadWindow'); vscode.l10n.t('Reload Window')
);
if (selection) {
await vscode.commands.executeCommand('workbench.action.reloadWindow');
}
} }
} }
})); }));