Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/renderer/components/CommentSection/CommentSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@
v-else-if="showComments && !isLoading"
>
<h3
v-if="isPostComments"
v-if="areCommentsDisabled"
class="noCommentMsg"
>
{{ $t("Comments.Comments are turned off") }}
</h3>
<h3
v-else-if="isPostComments"
class="noCommentMsg"
>
{{ $t("Comments.There are no comments available for this post") }}
Expand Down Expand Up @@ -166,6 +172,7 @@ function onTimestamp(timestamp) {
const isLoading = ref(false)
const isMoreCommentsLoading = ref(false)
const showComments = ref(false)
const areCommentsDisabled = ref(false)
const nextPageToken = shallowRef(null)

/** @type {import('vue').ShallowRef<import('../FtComment/FtComment.vue').Comment[]>} */
Expand Down Expand Up @@ -255,6 +262,7 @@ function handleSortChange() {

function getCommentData() {
isLoading.value = true
areCommentsDisabled.value = false

if (!process.env.SUPPORTS_LOCAL_API || backendPreference.value === 'invidious') {
if (!props.isPostComments) {
Expand Down Expand Up @@ -335,6 +343,7 @@ async function getCommentDataLocal(more = false) {
nextPageToken.value = null
isLoading.value = false
showComments.value = true
areCommentsDisabled.value = true
localCommentsInstance = undefined
return
}
Expand Down Expand Up @@ -381,6 +390,7 @@ async function getCommentDataInvidious() {
nextPageToken.value = null
isLoading.value = false
showComments.value = true
areCommentsDisabled.value = true
return
}
// endregion No comment detection
Expand Down Expand Up @@ -413,6 +423,15 @@ async function getPostCommentsInvidious() {
isLoading.value = false
showComments.value = true
} catch (err) {
if (err.message.includes('Comments not found')) {
Comment thread
Shadorc marked this conversation as resolved.
commentData.value = []
nextPageToken.value = null
isLoading.value = false
showComments.value = true
areCommentsDisabled.value = true
return
}

console.error(err)
const errorMessage = t('Invidious API Error (Click to copy)')
showToast(`${errorMessage}: ${err}`, 10000, () => {
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ Comments:
There are no comments available for this video: There are no comments available
for this video
There are no comments available for this post: There are no comments available for this post
Comments are turned off: Comments are turned off
Load More Comments: Load More Comments
Pinned by: Pinned by
Member: Member
Expand Down