diff --git a/src/cli/cliUtils.ts b/src/cli/cliUtils.ts index dd65d81..850c994 100644 --- a/src/cli/cliUtils.ts +++ b/src/cli/cliUtils.ts @@ -25,10 +25,6 @@ export type CombinedVariableData = { configurations?: FeatureConfigurationWithEnvNames[] } -export const initStorage = async () => { - await Promise.all([getAllVariables(), getAllFeatures(), getAllEnvironments()]) -} - export const getCombinedVariableDetails = async ( variable: string | Variable, ) => { 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..39d88b8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ ;('use strict') import * as vscode from 'vscode' import { KEYS, StateManager } from './StateManager' -import { init, login, logout, status as cliStatus, initStorage } from './cli' +import { init, login, logout, status as cliStatus } from './cli' import { CLIENT_KEYS, SecretStateManager } from './SecretStateManager' import { loadConfig, autoLoginIfHaveCredentials } from './utils/credentials' import { SidebarProvider } from './components/SidebarProvider' @@ -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')