If the setting value is the same, do nothing (#223518)

It seems like this event fires in Codespaces... my _guess_ is that Codespaces basically overwrites all the settings from settings sync which causes this event to fire.

It's surprising to me that this event fires even though the value hasn't changed.

I can't repro this with the test resolver, and I also cant have Codespaces use Code - OSS, so we'll just have to see how this goes.

This _should_ do the trick though.

Fixes https://github.com/microsoft/vscode/issues/223508
This commit is contained in:
Tyler James Leonhardt 2024-07-24 10:11:27 -07:00 committed by GitHub
parent afe1dc68da
commit 3873c58c47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,6 +142,10 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
this.context.secrets.onDidChange(() => this.checkForUpdates()), this.context.secrets.onDidChange(() => this.checkForUpdates()),
vscode.workspace.onDidChangeConfiguration(async e => { vscode.workspace.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration('github.experimental.multipleAccounts')) { if (e.affectsConfiguration('github.experimental.multipleAccounts')) {
const newValue = vscode.workspace.getConfiguration('github.experimental').get<boolean>('multipleAccounts', false);
if (newValue === this._supportsMultipleAccounts) {
return;
}
const result = await vscode.window.showInformationMessage(vscode.l10n.t('Please reload the window to apply the new setting.'), { modal: true }, vscode.l10n.t('Reload Window')); const result = await vscode.window.showInformationMessage(vscode.l10n.t('Please reload the window to apply the new setting.'), { modal: true }, vscode.l10n.t('Reload Window'));
if (result) { if (result) {
vscode.commands.executeCommand('workbench.action.reloadWindow'); vscode.commands.executeCommand('workbench.action.reloadWindow');