修复客户端常用设置读写卡顿
Project CI / Repository checks (pull_request) Successful in 2m30s
Project CI / Frontend tests (pull_request) Successful in 2m46s
Project CI / Backend tests (pull_request) Successful in 5m57s
Project CI / Native shell tests (pull_request) Failing after 15m32s

移除常用设置读取和保存后的外部诊断调用
减少配置读取时的重复权限修复和保存后的重复回读
补充常用设置无需外部诊断的原因注释
This commit is contained in:
2026-09-08 12:58:29 +00:00
parent 1498247e9f
commit 5efd88cb3e
3 changed files with 9 additions and 24 deletions
@@ -470,6 +470,7 @@ export function RuntimeConfigDialog({
}));
}
// 常用设置仅调整运行参数,读写时无需外部诊断,避免进程探测拖慢页面加载和保存反馈。
async function readRuntimeConfig() {
if (runtimeConfigBusyRef.current) {
return;
@@ -494,15 +495,6 @@ export function RuntimeConfigDialog({
);
setRuntimeConfigDraft(config);
setRuntimeConfigStatus(`已读取:${result.path}`);
try {
const status = await invoke<GameCreatorLlmConfigStatus>(
'check_game_creator_llm_config',
);
setEffectiveLlmConfigStatus(status);
} catch {
// Older test fixtures and non-Tauri previews may not expose the
// diagnostic command; the config read itself remains usable.
}
onLog?.('runtime_config.read');
} catch (error) {
setRuntimeConfigStatus(
@@ -551,15 +543,6 @@ export function RuntimeConfigDialog({
);
setRuntimeConfigDraft(savedConfig);
setRuntimeConfigStatus(`已保存:${result.path}`);
try {
const status = await invoke<GameCreatorLlmConfigStatus>(
'check_game_creator_llm_config',
);
setEffectiveLlmConfigStatus(status);
} catch {
// Keep the last safe status when the optional diagnostic refresh is
// unavailable in a preview or test fixture.
}
setRuntimeConfigToast({
tone: 'success',
message: '保存成功,新的运行时配置已生效',