Skip to content

Commit df58df8

Browse files
Only fire once (microsoft#188523)
Fixes microsoft#188460
1 parent 723714b commit df58df8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/vs/platform/secrets/common/secrets.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ export abstract class BaseSecretStorageService implements ISecretStorageService
128128
}
129129

130130
this._onDidChangeValueDisposable?.dispose();
131-
this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => this.onDidChangeValue(e.key));
131+
this._onDidChangeValueDisposable = storageService.onDidChangeValue(e => {
132+
// We only care about changes to the application scope since SecretStorage
133+
// only stores secrets in the application scope but this seems to fire
134+
// 2 events. Once for APP scope and once for PROFILE scope. ref #188460
135+
if (e.scope === StorageScope.APPLICATION) {
136+
this.onDidChangeValue(e.key);
137+
}
138+
});
132139
return storageService;
133140
}
134141

0 commit comments

Comments
 (0)