mobergmann / sportsfriend

1 stars 0 forks source link

Log: Sorting users by amount not working #12

Closed mobergmann closed 9 months ago

mobergmann commented 9 months ago

Apparently sorting the users doesn't work: image

I had a peek at the source code and apparently the sorting function is broken. To be specific, the lines

let lhs_sum = lhs.activities.reduce((a, b) => a.amount + b.amount, 0);
let rhs_sum = rhs.activities.reduce((a, b) => a.amount + b.amount, 0);

return NaN and the comparison of NaN values is not utile when sorting.