fix: stabilize cron scheduling and run history
This commit is contained in:
@@ -553,7 +553,11 @@ export const useSchedulesStore = create<State & Actions>((set, get) => {
|
||||
} catch (error) {
|
||||
if (showLoading) await handleError(error, "运行记录加载失败");
|
||||
} finally {
|
||||
if (showLoading) set({ runsLoading: false });
|
||||
// 如果用户已切换到另一个调度方案,不能让旧请求结束时覆盖新方案的
|
||||
// 加载状态;新方案会由自己的请求负责关闭 loading。
|
||||
if (showLoading && get().schedule?.schedule_id === scheduleId) {
|
||||
set({ runsLoading: false });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user