From 3c9bf877c7c7311ef82976a0e3a61b97365863ec Mon Sep 17 00:00:00 2001 From: Elliot Campbell Date: Mon, 31 Jul 2023 14:38:14 -0400 Subject: [PATCH] pre-seed all variables/features/envs before refreshing --- src/components/UsagesTreeProvider.ts | 4 +++- src/extension.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/UsagesTreeProvider.ts b/src/components/UsagesTreeProvider.ts index d8b373b..44b98b4 100644 --- a/src/components/UsagesTreeProvider.ts +++ b/src/components/UsagesTreeProvider.ts @@ -4,9 +4,11 @@ import { JSONMatch, VariableReference, getAllVariables, + getAllEnvironments, getCombinedVariableDetails, CombinedVariableData, getOrganizationId, + getAllFeatures, } from '../cli' import { showBusyMessage, hideBusyMessage } from './statusBarItem' @@ -44,7 +46,7 @@ export class UsagesTreeProvider private async getCombinedAPIData() { showBusyMessage('Fetching devcycle data') - const variables = await getAllVariables() + const [variables] = await Promise.all([getAllVariables(), getAllFeatures(), getAllEnvironments()]) const result = {} as Record await Promise.all( Object.entries(variables).map(async ([key, variable]) => { diff --git a/src/extension.ts b/src/extension.ts index 06a935e..bf2ba61 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -21,7 +21,6 @@ export const activate = async (context: vscode.ExtensionContext) => { SecretStateManager.init(context) StateManager.globalState = context.globalState StateManager.workspaceState = context.workspaceState - StateManager.clearState() const autoLogin = vscode.workspace .getConfiguration('devcycle-featureflags') .get('loginOnWorkspaceOpen')