Skip to content

Commit fa33cd5

Browse files
load predictions after positions
1 parent ed40467 commit fa33cd5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

js/tracker.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,11 @@ function clean_refresh(text, force, history_step) {
372372
listScroll.refresh();
373373

374374
lhash_update(history_step);
375+
376+
clearTimeout(periodical);
377+
clearTimeout(periodical_receivers);
378+
375379
refresh();
376-
refreshPredictions();
377380

378381
return true;
379382
}
@@ -2265,8 +2268,11 @@ function refresh() {
22652268
if(ajax_inprogress) {
22662269
clearTimeout(periodical);
22672270
periodical = setTimeout(refresh, 2000);
2271+
return;
22682272
}
22692273

2274+
ajax_inprogress = true;
2275+
22702276
$("#stText").text("checking |");
22712277

22722278
if(/[a-z0-9]{32}/ig.exec(wvar.query)) {
@@ -2288,7 +2294,6 @@ function refresh() {
22882294
data: data_str,
22892295
dataType: "json",
22902296
success: function(response, textStatus) {
2291-
ajax_inprogress = true;
22922297
$("#stText").text("loading |");
22932298
response.fetch_timestamp = Date.now();
22942299
update(response);
@@ -2340,7 +2345,11 @@ var ajax_predictions = null;
23402345

23412346
function refreshPredictions() {
23422347
//if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'ajax', 'refresh', 'Predictions']);
2343-
clearTimeout(periodical_predictions);
2348+
if(ajax_inprogress) {
2349+
clearTimeout(periodical_predictions);
2350+
periodical_predictions = setTimeout(refreshPredictions, 1000);
2351+
return;
2352+
}
23442353

23452354
ajax_predictions = $.ajax({
23462355
type: "GET",

0 commit comments

Comments
 (0)