1
0

Fix sorting tasks by bool values

There was a bug where it would return all tasks with a true value before the ones with a false value. This is the exact opposite of what the db does, leading to wrongly sorted values
This commit is contained in:
kolaente
2019-12-07 16:56:18 +01:00
parent d8399e374c
commit 1555f04bd2
2 changed files with 53 additions and 17 deletions

View File

@ -146,9 +146,9 @@ func mustMakeComparator(fieldName string) taskComparator {
return func(lhs, rhs *Task) int64 {
boolLHS, boolRHS := extractProp(lhs).(bool), extractProp(rhs).(bool)
if !boolLHS && boolRHS {
return 1
} else if boolLHS && !boolRHS {
return -1
} else if boolLHS && !boolRHS {
return 1
}
return 0
}