From ed9ada5fe9e29bdadf930b880de83036bef805af Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 13 Oct 2026 20:58:38 -0700 Subject: [PATCH] fix(orcad): move host account env restore out of orcad-entry to clear max-lines (#28529) Co-authored-by: Claude --- src/main/orcad/orcad-entry.ts | 8 ++------ src/main/orcad/orcad-host-account-launch-env-store.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/orcad/orcad-entry.ts b/src/main/orcad/orcad-entry.ts index 9120e050cc6..f27d0bcb35b 100644 --- a/src/main/orcad/orcad-entry.ts +++ b/src/main/orcad/orcad-entry.ts @@ -291,12 +291,8 @@ async function startOrcadRuntime( }) // Why before any launch: a desktop that owns this host's accounts pushed them on an earlier run. - const { readOrcadHostAccountLaunchEnv, writeOrcadHostAccountLaunchEnv } = - await import('./orcad-host-account-launch-env-store') - runtime.restoreHostAccountLaunchEnv( - readOrcadHostAccountLaunchEnv(runtimeUserDataPath), - (launchEnv) => writeOrcadHostAccountLaunchEnv(runtimeUserDataPath, launchEnv) - ) + const { restoreOrcadHostAccountLaunchEnv } = await import('./orcad-host-account-launch-env-store') + restoreOrcadHostAccountLaunchEnv(runtime, runtimeUserDataPath) const { installOrcadSessionSearchService } = await import('./orcad-session-search') sessionSearch = await installOrcadSessionSearchService({ diff --git a/src/main/orcad/orcad-host-account-launch-env-store.ts b/src/main/orcad/orcad-host-account-launch-env-store.ts index 2dab54701fb..ad37bdfd964 100644 --- a/src/main/orcad/orcad-host-account-launch-env-store.ts +++ b/src/main/orcad/orcad-host-account-launch-env-store.ts @@ -9,6 +9,7 @@ import { HostAccountLaunchEnvParams, type HostAccountLaunchEnv } from '../../shared/host-account-launch-env' +import type { OrcaRuntimeService } from '../runtime/orca-runtime' const FILE_NAME = 'host-account-launch-env.json' @@ -41,3 +42,12 @@ export function writeOrcadHostAccountLaunchEnv( throw error } } + +export function restoreOrcadHostAccountLaunchEnv( + runtime: Pick, + userDataPath: string +): void { + runtime.restoreHostAccountLaunchEnv(readOrcadHostAccountLaunchEnv(userDataPath), (launchEnv) => + writeOrcadHostAccountLaunchEnv(userDataPath, launchEnv) + ) +}