From e8590dd6f169c3caaa42fc1489f1499683334ed0 Mon Sep 17 00:00:00 2001 From: Alma Date: Sat, 12 Apr 2025 23:05:33 +0200 Subject: [PATCH] working leantime widget 123 --- components/flow.tsx | 6 ++++++ 1 file changed, 6 insertions(+) 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);