Merge pull request #1657 from jksladjflkjsadflkjsadf/fixsetinterval

fix incorrect use of setinterval in js
This commit is contained in:
TheFrenchGhosty 2021-01-12 13:52:53 +00:00 committed by GitHub
commit 920785631b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -69,7 +69,7 @@ if (location.pathname.startsWith('/embed/')) {
player.on('error', function (event) { player.on('error', function (event) {
if (player.error().code === 2 || player.error().code === 4) { if (player.error().code === 2 || player.error().code === 4) {
setInterval(setTimeout(function (event) { setTimeout(function (event) {
console.log('An error occured in the player, reloading...'); console.log('An error occured in the player, reloading...');
var currentTime = player.currentTime(); var currentTime = player.currentTime();
@ -88,7 +88,7 @@ player.on('error', function (event) {
if (!paused) { if (!paused) {
player.play(); player.play();
} }
}, 5000), 5000); }, 5000);
} }
}); });

View file

@ -272,7 +272,7 @@ function get_reddit_comments(retries) {
xhr.onerror = function () { xhr.onerror = function () {
console.log('Pulling comments failed... ' + retries + '/5'); console.log('Pulling comments failed... ' + retries + '/5');
setInterval(function () { get_reddit_comments(retries - 1) }, 1000); setTimeout(function () { get_reddit_comments(retries - 1) }, 1000);
} }
xhr.ontimeout = function () { xhr.ontimeout = function () {
@ -346,7 +346,7 @@ function get_youtube_comments(retries) {
comments.innerHTML = comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>'; '<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5'); console.log('Pulling comments failed... ' + retries + '/5');
setInterval(function () { get_youtube_comments(retries - 1) }, 1000); setTimeout(function () { get_youtube_comments(retries - 1) }, 1000);
} }
xhr.ontimeout = function () { xhr.ontimeout = function () {