Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc1c391

Browse files
authored
Compare global storage data using only key (microsoft#21636)
Closes microsoft#21635 by applying the same fix as done in microsoft#17627.
1 parent f4d7556 commit fc1c391

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/common/persistentState.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export interface IPersistentStorage<T> {
173173
*/
174174
export function getGlobalStorage<T>(context: IExtensionContext, key: string, defaultValue?: T): IPersistentStorage<T> {
175175
const globalKeysStorage = new PersistentState<KeysStorage[]>(context.globalState, GLOBAL_PERSISTENT_KEYS, []);
176-
const found = globalKeysStorage.value.find((value) => value.key === key && value.defaultValue === defaultValue);
176+
const found = globalKeysStorage.value.find((value) => value.key === key);
177177
if (!found) {
178178
const newValue = [{ key, defaultValue }, ...globalKeysStorage.value];
179179
globalKeysStorage.updateValue(newValue).ignoreErrors();

0 commit comments

Comments
 (0)