summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>2021-01-12 13:52:53 +0000
committerGitHub <noreply@github.com>2021-01-12 13:52:53 +0000
commit920785631bf6a37583532af09b4492f6ed3f95f2 (patch)
tree5d76bd4e5e5fdd98d948a19db647aec86be3907a
parentc28b1f6fb9901aa033dccf5273392d30162953d7 (diff)
parent5a08dfa72f26a250b09c643c47cd4abc18e3843c (diff)
downloadinvidious-920785631bf6a37583532af09b4492f6ed3f95f2.tar.gz
invidious-920785631bf6a37583532af09b4492f6ed3f95f2.tar.bz2
invidious-920785631bf6a37583532af09b4492f6ed3f95f2.zip
Merge pull request #1657 from jksladjflkjsadflkjsadf/fixsetinterval
fix incorrect use of setinterval in js
-rw-r--r--assets/js/player.js4
-rw-r--r--assets/js/watch.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/assets/js/player.js b/assets/js/player.js
index fcba43d8..932de581 100644
--- a/assets/js/player.js
+++ b/assets/js/player.js
@@ -69,7 +69,7 @@ if (location.pathname.startsWith('/embed/')) {
player.on('error', function (event) {
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...');
var currentTime = player.currentTime();
@@ -88,7 +88,7 @@ player.on('error', function (event) {
if (!paused) {
player.play();
}
- }, 5000), 5000);
+ }, 5000);
}
});
diff --git a/assets/js/watch.js b/assets/js/watch.js
index 05530f3d..eb493bf3 100644
--- a/assets/js/watch.js
+++ b/assets/js/watch.js
@@ -272,7 +272,7 @@ function get_reddit_comments(retries) {
xhr.onerror = function () {
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 () {
@@ -346,7 +346,7 @@ function get_youtube_comments(retries) {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
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 () {