Skip to content

Commit

Permalink
Compare global storage data using only key (#21636)
Browse files Browse the repository at this point in the history
Closes #21635 by
applying the same fix as done in
#17627.
  • Loading branch information
msujew authored Jul 17, 2023
1 parent f4d7556 commit fc1c391
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/common/persistentState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export interface IPersistentStorage<T> {
*/
export function getGlobalStorage<T>(context: IExtensionContext, key: string, defaultValue?: T): IPersistentStorage<T> {
const globalKeysStorage = new PersistentState<KeysStorage[]>(context.globalState, GLOBAL_PERSISTENT_KEYS, []);
const found = globalKeysStorage.value.find((value) => value.key === key && value.defaultValue === defaultValue);
const found = globalKeysStorage.value.find((value) => value.key === key);
if (!found) {
const newValue = [{ key, defaultValue }, ...globalKeysStorage.value];
globalKeysStorage.updateValue(newValue).ignoreErrors();
Expand Down

0 comments on commit fc1c391

Please sign in to comment.