From: Steinar H. Gunderson Date: Sun, 25 Dec 2022 17:09:06 +0000 (+0100) Subject: Fix some issues with exploring the wrong lines, especially when the backend probes... X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=b41458a32bb6393591004219c0adf4c2844ee1ca Fix some issues with exploring the wrong lines, especially when the backend probes fail. --- diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 3ebba93..b06a45a 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -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.