From 66972a90f765bbae8430cf5251ac7c8aafae734f Mon Sep 17 00:00:00 2001 From: Rankin Zheng Date: Mon, 2 Sep 2024 14:51:14 +0800 Subject: [PATCH] refactor(Config): update workflow list with settled state management Refactor the workflow list update logic in the Config page to handle the loading state more efficiently. Now, it waits for the workflow list update to complete before setting the settled state to true and updating the route to "chat". This sequence ensures that the loading indicator is not visible unnecessarily and improves the user experience. --- src/views/pages/Config.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/pages/Config.tsx b/src/views/pages/Config.tsx index eef861d..333ff1b 100644 --- a/src/views/pages/Config.tsx +++ b/src/views/pages/Config.tsx @@ -171,7 +171,11 @@ const Config = observer(() => { config.updateSettle(false); startLoading(); // update workflow list - config.updateWorkflowList(); + config.updateWorkflowList().then(() => { + config.updateSettle(true); + router.updateRoute("chat"); + closeLoading(); + }); }; const changeModelDetail = (key: string, value: number | string) => {