From 95b2a99cd7bde27172d8a8b3be71397add069a64 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 18 Oct 2023 15:53:18 -0400 Subject: [PATCH] Avoids updating context if value matches --- src/system/context.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system/context.ts b/src/system/context.ts index e217cc4..ddb6980 100644 --- a/src/system/context.ts +++ b/src/system/context.ts @@ -14,6 +14,8 @@ export function getContext(key: ContextKeys, defaultValue?: T): T | undefined } export async function setContext(key: ContextKeys, value: unknown): Promise { + if (contextStorage.get(key) === value) return; + contextStorage.set(key, value); void (await executeCoreCommand('setContext', key, value)); _onDidChangeContext.fire(key);