X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=bed5a5cdf8ad3d1fdd4de3eb9cff1f8b39d17b4b;hb=d9f38cb28bf7ceac256e78c47043cb08a5e2da3a;hp=1e899298cef2997c7392376d1fc8126c78ed1cd0;hpb=a3baa02379ebf758b5a5a937ecee335c0e780e4c;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 1e89929..bed5a5c 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. @@ -780,6 +780,10 @@ var update_refutation_lines = function() { var tbl = $("#refutationlines"); tbl.empty(); + if (display_lines.length < 2) { + return; + } + // Find out where the lines start from. var base_line = []; var base_scores = display_lines[1].scores; @@ -1260,7 +1264,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;