修复客户端常用设置读写卡顿
移除常用设置读取和保存后的外部诊断调用 减少配置读取时的重复权限修复和保存后的重复回读 补充常用设置无需外部诊断的原因注释
This commit is contained in:
@@ -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: '保存成功,新的运行时配置已生效',
|
||||
|
||||
Reference in New Issue
Block a user