forked from midou/invidious
Don't show comments when commentCount is 0
This commit is contained in:
parent
25c3ee034e
commit
000cfd4834
@ -248,18 +248,22 @@ function get_youtube_comments() {
|
|||||||
if (xhr.readyState == 4)
|
if (xhr.readyState == 4)
|
||||||
if (xhr.status == 200) {
|
if (xhr.status == 200) {
|
||||||
comments = document.getElementById("comments");
|
comments = document.getElementById("comments");
|
||||||
comments.innerHTML = `
|
if (xhr.response.commentCount > 0) {
|
||||||
<div>
|
comments.innerHTML = `
|
||||||
<h3>
|
<div>
|
||||||
<a href="javascript:void(0)" onclick="toggle_comments(this)">[ - ]</a>
|
<h3>
|
||||||
View {commentCount} comments
|
<a href="javascript:void(0)" onclick="toggle_comments(this)">[ - ]</a>
|
||||||
</h3>
|
View {commentCount} comments
|
||||||
</div>
|
</h3>
|
||||||
<div>{contentHtml}</div>
|
</div>
|
||||||
<hr>`.supplant({
|
<div>{contentHtml}</div>
|
||||||
contentHtml: xhr.response.contentHtml,
|
<hr>`.supplant({
|
||||||
commentCount: commaSeparateNumber(xhr.response.commentCount)
|
contentHtml: xhr.response.contentHtml,
|
||||||
});
|
commentCount: commaSeparateNumber(xhr.response.commentCount)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
comments.innerHTML = "";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
<% if preferences && preferences.comments[1] == "youtube" %>
|
<% if preferences && preferences.comments[1] == "youtube" %>
|
||||||
get_youtube_comments();
|
get_youtube_comments();
|
||||||
|
Loading…
Reference in New Issue
Block a user