summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-23 16:55:26 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-23 16:55:26 -0500
commit0e7c56687be77aea465b48a380e910e5d6457c46 (patch)
treea27263f7b873e42fb866b0ec4a0a22e259a7ba96
parent01a80995d3ebfc0edd18d3d27de22adf3595e8be (diff)
downloadinvidious-0e7c56687be77aea465b48a380e910e5d6457c46.tar.gz
invidious-0e7c56687be77aea465b48a380e910e5d6457c46.tar.bz2
invidious-0e7c56687be77aea465b48a380e910e5d6457c46.zip
Add error message for comment timeouts
-rw-r--r--src/invidious/comments.cr4
-rw-r--r--src/invidious/views/watch.ecr8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index d9f86f69..983a3e92 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -93,7 +93,7 @@ def template_youtube_comments(comments)
<div class="pure-u-23-24">
<p>
<a href="javascript:void(0)" data-continuation="#{child["replies"]["continuation"]}"
- onclick="load_comments(this)">View #{child["replies"]["replyCount"]} replies</a>
+ onclick="get_youtube_replies(this)">View #{child["replies"]["replyCount"]} replies</a>
</p>
</div>
</div>
@@ -127,7 +127,7 @@ def template_youtube_comments(comments)
<div class="pure-u-1">
<p>
<a href="javascript:void(0)" data-continuation="#{comments["continuation"]}"
- onclick="load_comments(this)">Load more</a>
+ onclick="get_youtube_replies(this)">Load more</a>
</p>
</div>
</div>
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index 4b795b45..1f854d2a 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -53,7 +53,7 @@ function toggle_comments(target) {
}
}
-function load_comments(target) {
+function get_youtube_replies(target) {
var continuation = target.getAttribute("data-continuation");
var body = target.parentNode.parentNode;
@@ -80,6 +80,8 @@ function load_comments(target) {
};
xhr.ontimeout = function() {
+ console.log("Pulling comments timed out.");
+
body.innerHTML = fallback;
};
}
@@ -119,6 +121,8 @@ function get_reddit_comments() {
};
xhr.ontimeout = function() {
+ console.log("Pulling comments timed out.");
+
get_reddit_comments();
};
}
@@ -154,6 +158,8 @@ function get_youtube_comments() {
};
xhr.ontimeout = function() {
+ console.log("Pulling comments timed out.");
+
comments = document.getElementById("comments");
comments.innerHTML =
'<h3><center class="loading"><i class="icon ion-ios-refresh"></i></center></h3>';