]> git.sesse.net Git - remoteglot/commitdiff
Fix an issue where we would sort the wrong way when browsing history.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Nov 2018 20:22:23 +0000 (21:22 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Nov 2018 20:22:23 +0000 (21:22 +0100)
www/js/remoteglot.js

index d89da33b3d5339f5b581c356ba2fb68af78f3389..1e899298cef2997c7392376d1fc8126c78ed1cd0 100644 (file)
@@ -796,7 +796,7 @@ var update_refutation_lines = function() {
        }
 
        var invert = (toplay === 'B');
        }
 
        var invert = (toplay === 'B');
-       if (current_display_line && current_display_move % 2 == 0) {
+       if (current_display_line && current_display_move % 2 == 0 && !current_display_line_is_history) {
                invert = !invert;
        }
        moves = moves.sort(function(a, b) { return compare_by_score(refutation_lines, invert, a, b) });
                invert = !invert;
        }
        moves = moves.sort(function(a, b) { return compare_by_score(refutation_lines, invert, a, b) });