From 185b605764b6651148f56a614f1e419dfd15401d Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Tue, 17 Oct 2023 19:10:24 +0200 Subject: [PATCH] fix: update code settings only after login (#381) --- src/snyk/base/modules/snykLib.ts | 1 + src/snyk/extension.ts | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/snyk/base/modules/snykLib.ts b/src/snyk/base/modules/snykLib.ts index f9a639f03..070350d5d 100644 --- a/src/snyk/base/modules/snykLib.ts +++ b/src/snyk/base/modules/snykLib.ts @@ -28,6 +28,7 @@ export default class SnykLib extends BaseSnykModule implements ISnykLib { await this.contextService.setContext(SNYK_CONTEXT.AUTHENTICATING, false); await this.contextService.setContext(SNYK_CONTEXT.LOGGEDIN, true); + await this.codeSettings.updateIsCodeEnabled(); if (!configuration.getFeaturesConfiguration()) { return; diff --git a/src/snyk/extension.ts b/src/snyk/extension.ts index 01b31af4a..a3688f750 100644 --- a/src/snyk/extension.ts +++ b/src/snyk/extension.ts @@ -408,12 +408,7 @@ class SnykExtension extends SnykLib implements IExtension { await this.languageServer.start(); // initialize contexts - const loggedIn = await configuration.getToken(); - if (loggedIn != undefined) { - await this.contextService.setContext(SNYK_CONTEXT.LOGGEDIN, true); - } await this.contextService.setContext(SNYK_CONTEXT.INITIALIZED, true); - await this.codeSettings.updateIsCodeEnabled(); // Actually start analysis this.runScan();