Skip to content

Commit fd8d2dd

Browse files
always first fetch predictions after clean_refresh()
1 parent 1bfe441 commit fd8d2dd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/tracker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,6 +2267,8 @@ function refresh() {
22672267
complete: function(request, textStatus) {
22682268
clearTimeout(periodical);
22692269
periodical = setTimeout(refresh, timer_seconds * 1000);
2270+
2271+
if(periodical_predictions === null) refreshPredictions();
22702272
}
22712273
});
22722274
}
@@ -2461,7 +2463,8 @@ function initHabitat() {
24612463
}
24622464

24632465

2464-
var periodical, periodical_receivers, periodical_predictions;
2466+
var periodical, periodical_receivers;
2467+
var periodical_predictions = null;
24652468
var timer_seconds = 15;
24662469

24672470
function startAjax() {
@@ -2475,9 +2478,6 @@ function startAjax() {
24752478

24762479
//periodical_listeners = setInterval(refreshReceivers, 60 * 1000);
24772480
refreshReceivers();
2478-
2479-
//periodical_predictions = setInterval(refreshPredictions, 2 * timer_seconds * 1000);
2480-
refreshPredictions();
24812481
}
24822482

24832483
function stopAjax() {
@@ -2486,6 +2486,7 @@ function stopAjax() {
24862486
if(ajax_positions) ajax_positions.abort();
24872487

24882488
clearTimeout(periodical_predictions);
2489+
periodical_predictions = null;
24892490
if(ajax_predictions) ajax_predictions.abort();
24902491
}
24912492

0 commit comments

Comments
 (0)