Skip to content

Commit 6e76d41

Browse files
committed
fixed setTimeout and setInterval related issues
1 parent 168792b commit 6e76d41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎js/solari.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ function addSolariBoard(divSelector) {
201201
}
202202
}
203203
solari_setup_done = 1;
204+
window.setInterval(function (){updateSolariBoard()}, 1000 * REFRESH_TIME);
204205
updateSolariBoard();
205206
}
206207

@@ -350,12 +351,11 @@ function updateSolariBoard() {
350351
}
351352

352353
if (!failboard && typeof solariData === 'undefined') {
354+
window.clearTimeout(solariTimeout);
353355
window.setTimeout(updateSolariBoard, 1000);
354356
return;
355357
}
356358

357-
window.setInterval(updateSolariBoard, 1000 * REFRESH_TIME);
358-
359359
try {
360360
if (solariData.length === 0) {
361361
clearBoard();

0 commit comments

Comments
 (0)