X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=3d5290699366ff42ab8e0b7acb657fa94f0fee97;hb=e961331f0f08ba475f53599442c0d330bd520c91;hp=d89da33b3d5339f5b581c356ba2fb68af78f3389;hpb=6b412ffcd5797613037e4d69c39f8b4a3f0254f9;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index d89da33..3d52906 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -7,7 +7,7 @@ * @type {Number} * @const * @private */ -var SCRIPT_VERSION = 2016113007; +var SCRIPT_VERSION = 2016113008; /** * The current backend URL. @@ -294,7 +294,7 @@ var request_update = function() { update_num_viewers(num_viewers); } else { console.log("Received invalid update, waiting five seconds and trying again."); - location.reload(true); + setTimeout(function() { location.reload(true); }, 5000); } // Next update. @@ -796,7 +796,7 @@ var update_refutation_lines = function() { } 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) }); @@ -1260,7 +1260,7 @@ var update_board = function() { if (!data['refutation_lines'] || !data['refutation_lines'][nonstupid_moves[i]] || !data['refutation_lines'][nonstupid_moves[i]]['pv'] || - data['refutation_lines'][nonstupid_moves[i]]['pv'].length < 1) { + data['refutation_lines'][nonstupid_moves[i]]['pv'].length < 2) { // Incomplete PV, abort. response = undefined; break;