fix(desktop): 替换 require() 为 ES import — 修复生产构建崩溃
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- connectionStore: 2 处 require() → loadConversationStore() 异步预加载 + 闭包引用
- saasStore: 1 处 require() → await import()(logout 是 async)
- llm-service: 1 处 require() → 顶层 import(无循环依赖)
- streamStore: 移除重复动态导入,统一使用顶层 useConnectionStore
- tsc --noEmit 0 errors
This commit is contained in:
iven
2026-04-15 00:47:29 +08:00
parent a8a0751005
commit 02a4ba5e75
4 changed files with 18 additions and 13 deletions

View File

@@ -57,7 +57,6 @@ async function tryRecoverFromAuthError(error: string): Promise<string | null> {
const newToken = await saasClient.refreshMutex();
if (newToken) {
// Update kernel config with refreshed token → triggers kernel re-init via changed api_key detection
const { useConnectionStore } = await import('../connectionStore');
const { getKernelClient } = await import('../../lib/kernel-client');
const kernelClient = getKernelClient();
const currentConfig = kernelClient.getConfig();