diff --git a/components/flow.tsx b/components/flow.tsx index 38e8b1ce..d67d446f 100644 --- a/components/flow.tsx +++ b/components/flow.tsx @@ -106,6 +106,12 @@ export function Flow() { const sortedTasks = tasks .filter((task: Task) => task.status !== 3) .sort((a: Task, b: Task) => { + // First sort by status (4 before 3) + if (a.status !== b.status) { + return b.status - a.status; + } + + // Then sort by dateToFinish const dateA = getValidDate(a); const dateB = getValidDate(b);