From 97bc9a439c022a88fba7be68f67e068361f6c467 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:47:23 -0700 Subject: [PATCH] Fix GitHub Authentication reload dialog appearing unnecessarily in remote tunnel scenarios (#261257) --- .../github-authentication/src/extension.ts | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/extensions/github-authentication/src/extension.ts b/extensions/github-authentication/src/extension.ts index 25c9cbd51af..f63e45762b6 100644 --- a/extensions/github-authentication/src/extension.ts +++ b/extensions/github-authentication/src/extension.ts @@ -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('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('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'); + } } } }));