diff --git a/packages/insomnia/src/plugins/context/data.ts b/packages/insomnia/src/plugins/context/data.ts index e63d0bf81..94185b1db 100644 --- a/packages/insomnia/src/plugins/context/data.ts +++ b/packages/insomnia/src/plugins/context/data.ts @@ -14,6 +14,8 @@ export const getWorkspaces = (activeProjectId?: string) => { if (activeProjectId) { return models.workspace.findByParentId(activeProjectId); } else { + // ARCHY NOTE: HMMM need to investigate this + // This code path was kept in case there was ever a time when the app wouldn't have an active project. // In over 5 months of monitoring in production, we never saw this happen. // Keeping it for defensive purposes, but it's not clear if it's necessary. diff --git a/packages/insomnia/src/ui/renderApp.tsx b/packages/insomnia/src/ui/renderApp.tsx index f0f563543..5a3ce0987 100644 --- a/packages/insomnia/src/ui/renderApp.tsx +++ b/packages/insomnia/src/ui/renderApp.tsx @@ -12,9 +12,9 @@ import { Workspace } from '../models/workspace'; export async function renderApp() { - const workspaces = await database.find(models.workspace.type) - console.log("workspaces.length detected _", workspaces.length); - if (workspaces.length === 0) await importPure(dummyStartingWorkspace()) + const workspaceNumber = await database.count(models.workspace.type) + console.log("workspaces detected ~>", workspaceNumber); + if (workspaceNumber === 0) await importPure(dummyStartingWorkspace()) const router = setupRouterStuff();