fix(App): remove outdated workflow list update calls

Removed the outdated calls to update the workflow list in both the App.tsx and ConfigStore.ts
files. This change streamlines the code and prevents the execution of redundant Local Service
commands that are no longer required, potentially improving performance and reducing unnecessary
network activity.
This commit is contained in:
Rankin Zheng 2024-08-27 18:32:16 +08:00
parent 87c6c104db
commit 56e30328be
2 changed files with 5 additions and 5 deletions

View File

@ -54,14 +54,17 @@ export default function App() {
const checkConfigs = () => { const checkConfigs = () => {
if (configCount === 3) { if (configCount === 3) {
compare_func(configs); compare_func(configs);
setReady(true); // 假设setReady是一个函数用于设置应用状态为准备就绪 // 假设setReady是一个函数用于设置应用状态为准备就绪
setReady(true);
// 调用 Local Service 更新工作流,更新、重载命令列表
MessageUtil.sendMessage({ command: "updateWorkflowList"});
} }
}; };
// 注册处理函数 // 注册处理函数
MessageUtil.registerHandler("readConfig", (data: { value: any }) => { MessageUtil.registerHandler("readConfig", (data: { value: any }) => {
config.setConfig(data.value); config.setConfig(data.value);
APIUtil.config(config.getAPIBase(), config.getUserKey()) APIUtil.config(config.getAPIBase(), config.getUserKey());
setReady(true); setReady(true);
config.fetchServerConfig(); config.fetchServerConfig();
handleConfig("user_config", data); handleConfig("user_config", data);

View File

@ -290,9 +290,6 @@ export const ConfigStore = types
console.log("fetchLLMs error: Failed to fetch server config"); console.log("fetchLLMs error: Failed to fetch server config");
MessageUtil.handleMessage({ command: "readServerConfig", value: undefined }); MessageUtil.handleMessage({ command: "readServerConfig", value: undefined });
} }
// 调用 Local Service 更新工作流,更新、重载命令列表
MessageUtil.sendMessage({ command: "updateWorkflowList"});
} catch (e) { } catch (e) {
console.log("fetchLLMs error:", e); console.log("fetchLLMs error:", e);
MessageUtil.handleMessage({ command: "readServerConfig", value: undefined }); MessageUtil.handleMessage({ command: "readServerConfig", value: undefined });