Skip to content

Commit f58898e

Browse files
committed
Fix reverse sorting
The unsafe fixes made by the biome linter actually changed behaviour in an unintended way. It had replaced `==` with `===`, which has much more sensible behaviour. But because the value of the input was of type String and we were comparing that to a Number the comparison now always failed. This fixes this regression by changing the code to explicitly parse the string as a number, instead of using the `==` comparison. The reason I hadn't noticed after applying the linter fixes is because my cache was not busted by the Django dev server, because it did not restart on JS only changes. This will be fixed in a follow up commit.
1 parent 8a42d48 commit f58898e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: media/commitfest/js/commitfest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function flagCommitted(committer) {
257257
}
258258

259259
function sortpatches(sortby) {
260-
const sortkey = $("#id_sortkey").val();
260+
const sortkey = Number.parseInt($("#id_sortkey").val());
261261
if (sortkey === sortby) {
262262
$("#id_sortkey").val(-sortby);
263263
} else if (-sortkey === sortby) {

0 commit comments

Comments
 (0)