From fc1c391c33fad027d1e51ff60cbf648668af4b1c Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Mon, 17 Jul 2023 22:16:13 +0200 Subject: [PATCH] Compare global storage data using only `key` (#21636) Closes https://github.com/microsoft/vscode-python/issues/21635 by applying the same fix as done in https://github.com/microsoft/vscode-python/pull/17627. --- src/client/common/persistentState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/common/persistentState.ts b/src/client/common/persistentState.ts index 48e885a676a2..76f6d2112fe0 100644 --- a/src/client/common/persistentState.ts +++ b/src/client/common/persistentState.ts @@ -173,7 +173,7 @@ export interface IPersistentStorage { */ export function getGlobalStorage(context: IExtensionContext, key: string, defaultValue?: T): IPersistentStorage { const globalKeysStorage = new PersistentState(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();