]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
When something goes wrong, actually wait five seconds instead of DoSing the backend.
[remoteglot] / www / js / remoteglot.js
index 1e899298cef2997c7392376d1fc8126c78ed1cd0..3d5290699366ff42ab8e0b7acb657fa94f0fee97 100644 (file)
@@ -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.
@@ -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;