fix(organize): 展示智能体处理状态并刷新恢复结果
This commit is contained in:
1 parent
86351f20f3
commit
b306d27d08
9 files changed
+172
-12
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import type { Decision } from "@umt/contracts";
|
||||
import { useDecisions } from "~/api/decisions.ts";
|
||||
import { humanizeReason } from "~/lib/reasons.ts";
|
||||
import { useSse } from "~/lib/sse.ts";
|
||||
import { EpisodeDecision } from "./decision.tsx";
|
||||
|
||||
// 集数待确认的原因(2026-10-06 去掉待处理中心后):不再作为逐条要处理的条目,
|
||||
@@ -16,6 +18,12 @@ function entityOf(d: Decision): string | null {
|
||||
|
||||
/** 某作品(可选按来源季)未关闭的集数待确认事项 */
|
||||
export function useEpisodeIssues(entityId: string | null | undefined, season?: number | null) {
|
||||
const qc = useQueryClient();
|
||||
useSse(["decision.created", "decision.updated"], () => {
|
||||
if (!entityId) return;
|
||||
void qc.invalidateQueries({ queryKey: ["decisions"] });
|
||||
void qc.invalidateQueries({ queryKey: ["episode-mapping"] });
|
||||
});
|
||||
const q = useDecisions({ kind: "episode_mapping" }, !!entityId);
|
||||
const items = (q.data?.pages.flatMap((p) => p.items) ?? []).filter(
|
||||
(d) =>
|
||||
|
||||
Reference in new issue
Block a user