feat: restore dispatch confirmation flows
This commit is contained in:
@@ -11,8 +11,9 @@ import {
|
||||
StatusBar,
|
||||
} from "@/components/app-ui";
|
||||
import { requirePageSession } from "@/lib/boss-auth";
|
||||
import { listDispatchPlansByProject, readState } from "@/lib/boss-data";
|
||||
import { latestPendingDispatchPlan } from "@/lib/dispatch-plan-ui";
|
||||
import { formatTimestampLabel, getProjectDetailView } from "@/lib/boss-projections";
|
||||
import { readState } from "@/lib/boss-data";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -25,6 +26,9 @@ export default async function ProjectChatPage({
|
||||
const { projectId } = await params;
|
||||
const state = await readState();
|
||||
const detail = getProjectDetailView(state, projectId);
|
||||
const pendingDispatchPlan = detail?.project.isGroup
|
||||
? latestPendingDispatchPlan(await listDispatchPlansByProject(projectId))
|
||||
: null;
|
||||
|
||||
if (!detail) notFound();
|
||||
|
||||
@@ -147,7 +151,21 @@ export default async function ProjectChatPage({
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<ChatComposer projectId={detail.project.id} />
|
||||
<ChatComposer
|
||||
projectId={detail.project.id}
|
||||
initialPendingDispatchPlan={
|
||||
pendingDispatchPlan
|
||||
? {
|
||||
planId: pendingDispatchPlan.planId,
|
||||
summary: pendingDispatchPlan.summary,
|
||||
targets: (pendingDispatchPlan.targets ?? []).map((target) => ({
|
||||
projectId: target.projectId,
|
||||
threadDisplayName: target.threadDisplayName,
|
||||
})),
|
||||
}
|
||||
: null
|
||||
}
|
||||
/>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user