auto-sync: 2026-05-20 23:38:03

This commit is contained in:
cfdaily
2026-05-20 23:38:03 +08:00
parent d74a17cabb
commit b613b58a2f
+14 -1
View File
@@ -476,7 +476,20 @@ export const useStore = create<AppStore>((set, get) => ({
// v2.6: 加载任务详情(expand=all
loadV2TaskDetail: async (taskId: string) => {
const pid = get().selectedProjectId;
if (!pid) return;
if (!pid) {
// 全部任务模式:从 v2tasks 中找任务的 _projectId
const task = (get().v2tasks || []).find((t: any) => t.id === taskId);
if (task && (task as any)._projectId) {
try {
const res = await fetch(`/api/projects/${(task as any)._projectId}/tasks/${taskId}?expand=all`);
if (res.ok) {
const detail = await res.json();
set({ v2taskDetail: { ...detail, _projectId: (task as any)._projectId } });
}
} catch { /* silently fail */ }
}
return;
}
try {
const res = await fetch(`/api/projects/${pid}/tasks/${taskId}?expand=all`);
if (res.ok) {