优化
This commit is contained in:
@@ -517,7 +517,11 @@ const saveToLocalStorage = () => {
|
||||
const saveToFile = async () => {
|
||||
if (!isElectronEnv) return
|
||||
try {
|
||||
await window.electronAPI.saveRunConfig(JSON.parse(JSON.stringify(config.value)))
|
||||
const configToSave = JSON.parse(JSON.stringify(config.value))
|
||||
// ConfigPage 不管理 filters,HostListDialog 会单独管理
|
||||
// 删除 filters 避免用 ConfigPage 中可能过期的状态覆盖后端
|
||||
delete configToSave.filters
|
||||
await window.electronAPI.saveRunConfig(configToSave)
|
||||
} catch (e) {
|
||||
console.error('保存配置失败:', e)
|
||||
}
|
||||
@@ -706,6 +710,15 @@ const handleStart = async (specificGroupIndex) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 预热所有视图,确保后台视图完成渲染,解决自动化执行失败问题
|
||||
try {
|
||||
console.log('[ConfigPage] 预热所有视图...')
|
||||
await window.electronAPI.warmUpViews()
|
||||
console.log('[ConfigPage] 视图预热完成')
|
||||
} catch (e) {
|
||||
console.warn('[ConfigPage] 视图预热失败,继续启动:', e)
|
||||
}
|
||||
|
||||
const results = await Promise.allSettled(
|
||||
startTasks.map(async ({ viewId, account, delay }) => {
|
||||
await new Promise(r => setTimeout(r, delay))
|
||||
|
||||
Reference in New Issue
Block a user