diff --git a/src/renderer/components/CommentSection/CommentSection.vue b/src/renderer/components/CommentSection/CommentSection.vue index 895fb13039555..d0dea62b7c1ed 100644 --- a/src/renderer/components/CommentSection/CommentSection.vue +++ b/src/renderer/components/CommentSection/CommentSection.vue @@ -67,7 +67,13 @@ v-else-if="showComments && !isLoading" >

+ {{ $t("Comments.Comments are turned off") }} +

+

{{ $t("Comments.There are no comments available for this post") }} @@ -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} */ @@ -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) { @@ -335,6 +343,7 @@ async function getCommentDataLocal(more = false) { nextPageToken.value = null isLoading.value = false showComments.value = true + areCommentsDisabled.value = true localCommentsInstance = undefined return } @@ -381,6 +390,7 @@ async function getCommentDataInvidious() { nextPageToken.value = null isLoading.value = false showComments.value = true + areCommentsDisabled.value = true return } // endregion No comment detection @@ -413,6 +423,15 @@ async function getPostCommentsInvidious() { isLoading.value = false showComments.value = true } catch (err) { + if (err.message.includes('Comments not found')) { + 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, () => { diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index fc99549fdbe9e..c2b42eb7407b1 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -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