Revert "Incorporate unused "unable to load comments" message": Split these changes to another PR

This reverts commit 5451391502.
This commit is contained in:
Samuel Casellas 2025-01-11 13:16:26 -05:00
parent 5451391502
commit 88e80d50ad
6 changed files with 9 additions and 13 deletions

View file

@ -106,8 +106,8 @@ function get_youtube_comments() {
}
},
onNon200: video_data.params.comments[1] === 'youtube'
? function (xhr) {}
: function (xhr) { comments.innerHTML = (xhr.response.error === 'Comments not found.' ? fallback.split('</noscript>')[1] : fallback.split('<p>')[0]) },
? function (xhr) {}
: function (xhr) { comments.innerHTML = fallback; },
onError: function (xhr) {
comments.innerHTML = spinnerHTML;
},

View file

@ -72,7 +72,7 @@ function get_youtube_replies(target, load_more) {
}
},
onNon200: function (xhr) {
body.innerHTML = (xhr.response.error === 'Comments not found.' ? fallback.split('</noscript>')[1] : fallback.split('<p>')[0]);
body.innerHTML = fallback;
},
onTimeout: function (xhr) {
console.warn('Pulling comments failed');

View file

@ -117,6 +117,10 @@ function get_reddit_comments() {
'?source=reddit&format=html' +
'&hl=' + video_data.preferences.locale;
var onNon200 = function (xhr) { comments.innerHTML = fallback; };
if (video_data.params.comments[1] === 'youtube')
onNon200 = function (xhr) {};
helpers.xhr('GET', url, {retries: 5, entity_name: ''}, {
on200: function (response) {
comments.innerHTML = ' \
@ -148,9 +152,7 @@ function get_reddit_comments() {
comments.children[0].children[0].children[0].onclick = toggle_comments;
comments.children[0].children[1].children[0].onclick = swap_comments;
},
onNon200: video_data.params.comments[1] === 'youtube'
? function (xhr) {}
: function (xhr) { comments.innerHTML = (xhr.response.error === 'Comments not found.' ? fallback.split('</noscript>')[1] : fallback.split('<p>')[0]); }
onNon200: onNon200, // declared above
});
}

View file

@ -234,7 +234,7 @@
"Deleted or invalid channel": "Deleted or invalid channel",
"This channel does not exist.": "This channel does not exist.",
"Could not get channel info.": "Could not get channel info.",
"Could not fetch comments": "Could not fetch comments (they may be turned off)",
"Could not fetch comments": "Could not fetch comments",
"comments_view_x_replies": "View {{count}} reply",
"comments_view_x_replies_plural": "View {{count}} replies",
"`x` ago": "`x` ago",

View file

@ -21,9 +21,6 @@
<%= translate(locale, "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.") %>
</a>
</noscript>
<p>
<%= translate(locale, "Could not fetch comments") %>
</p>
<% end %>
</div>
</div>

View file

@ -297,9 +297,6 @@ we're going to need to do it here in order to allow for translations.
<%= translate(locale, "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they may take a bit longer to load.") %>
</a>
</noscript>
<p>
<%= translate(locale, "Could not fetch comments") %>
</p>
<% end %>
</div>
</div>