diff --git a/src/components/Tasks/TaskList.tsx b/src/components/Tasks/TaskList.tsx index 73e3876..4690a6f 100644 --- a/src/components/Tasks/TaskList.tsx +++ b/src/components/Tasks/TaskList.tsx @@ -41,9 +41,9 @@ function sortDueDate(aIn: TaskType, bIn: TaskType) { } function sortPriority(aIn: TaskType, bIn: TaskType) { - // Intentionally converts 0/undefined to Infinity to sort to back of the list - const a = aIn.priority || Infinity; - const b = bIn.priority || Infinity; + // Intentionally converts 0/undefined to 10 (1 more than lowest priority) to sort to back of the list + const a = aIn.priority || 10; + const b = bIn.priority || 10; return a - b; } @@ -67,6 +67,7 @@ function getSortFunction(sortOrder: string) { break; case 'priority': sortFunctions.push(sortPriority); + sortFunctions.push(sortDueDate); break; case 'title': sortFunctions.push(sortTitle);