Only fire once (#188523)

Fixes https://github.com/microsoft/vscode/issues/188460
This commit is contained in:
Tyler James Leonhardt
2023-07-21 20:10:28 +02:00
committed by GitHub
parent 723714bc16
commit df58df8895
+8 -1
View File
@@ -128,7 +128,14 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
}
this._onDidChangeValueDisposable?.dispose();
this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => this.onDidChangeValue(e.key));
this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => {
// We only care about changes to the application scope since SecretStorage
// only stores secrets in the application scope but this seems to fire
// 2 events. Once for APP scope and once for PROFILE scope. ref #188460
if (e.scope === StorageScope.APPLICATION) {
this.onDidChangeValue(e.key);
}
});
return storageService;
}