From f2dde44a1e2826232ed8eacf11b4ef74e90449e7 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Tue, 17 Oct 2023 18:18:30 +0200 Subject: [PATCH 1/2] fix: update code settings only after login --- src/snyk/base/modules/snykLib.ts | 1 + 1 file changed, 1 insertion(+) 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; From 59d3c35193364ea47bc22d2cb5d8994f5469de2d Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Tue, 17 Oct 2023 18:55:29 +0200 Subject: [PATCH 2/2] fix: some more cleanup of the init code --- src/snyk/extension.ts | 5 ----- 1 file changed, 5 deletions(-) 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();