]> git.sesse.net Git - remoteglot/commitdiff
Fix some issues with exploring the wrong lines, especially when the backend probes...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 25 Dec 2022 17:09:06 +0000 (18:09 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 25 Dec 2022 17:09:06 +0000 (18:09 +0100)
www/js/remoteglot.js

index 3ebba936fc7f1480dc99f954d85ea55360e19454..b06a45ae2d82ff37b720b53087a7ae244da296bf 100644 (file)
@@ -839,6 +839,8 @@ let update_refutation_lines = function() {
        tbl.replaceChildren();
 
        if (display_lines.length < 2) {
+               // Update the move highlight, as we've rewritten all the HTML.
+               update_move_highlight();
                return;
        }
 
@@ -2020,7 +2022,11 @@ let explore_hash = function(fen) {
        fetch(backend_hash_url + "?fen=" + fen, { signal })
                .then((response) => response.json())
                .then((data) => { show_explore_hash_results(data, fen); })
-               .catch((err) => {});
+               .catch((err) => {
+                       // Truncate the lines, since we already cleared the display.
+                       display_lines = [ display_lines[0], display_lines[1] ];
+                       update_move_highlight();
+               });
 }
 
 /** Process the JSON response from a hash probe request.