No more comments, Comment repeat infinitely

Added:
No more comments - new toast with new string that is displayed when no
more comments are available

Fixed:
Comment repeat infinitely - comments now stop to load when all are
displayed.
This commit is contained in:
Luca 2020-10-05 20:31:45 +02:00
parent 68e73c8f8f
commit 890f2fc01b
4 changed files with 17 additions and 5 deletions

6
package-lock.json generated
View File

@ -20706,9 +20706,9 @@
}
},
"yt-comment-scraper": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.2.tgz",
"integrity": "sha512-i2e+7ZNm5Dvdwsk3W8UyKtxR2xjtcMfUVGUjxVAR31HlEb8wE66XslDr5eIxSCpbhCLV7ItbmvL8NGL3D1TSxw==",
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/yt-comment-scraper/-/yt-comment-scraper-1.3.3.tgz",
"integrity": "sha512-t0mIJOxsXriJTVIzQpRYz7BcAo2SbhhgY8YR2HJjxEq5zBYsu6mVujs8xzrCo1431hri1mDTanvLluS/WWCgjg==",
"requires": {
"axios": "^0.19.2",
"html2json": "^1.0.2"

View File

@ -42,7 +42,7 @@
"youtube-chat": "^1.1.0",
"youtube-suggest": "^1.1.0",
"yt-channel-info": "^1.1.2",
"yt-comment-scraper": "^1.3.2",
"yt-comment-scraper": "^1.3.3",
"yt-dash-manifest-generator": "^1.1.0",
"yt-trending-scraper": "^1.0.3",
"yt-xml2vtt": "^1.1.2",

View File

@ -4,6 +4,7 @@ import FtCard from '../ft-card/ft-card.vue'
import FtLoader from '../../components/ft-loader/ft-loader.vue'
import FtSelect from '../../components/ft-select/ft-select.vue'
import FtTimestampCatcher from '../../components/ft-timestamp-catcher/ft-timestamp-catcher.vue'
import CommentScraper from 'yt-comment-scraper'
export default Vue.extend({
@ -115,6 +116,16 @@ export default Vue.extend({
this.commentData = []
}
this.commentScraper.scrape_next_page_youtube_comments(this.id).then((response) => {
if (response === null) {
this.showToast({
message: this.$t('No more comments available'),
time: 7000,
action: () => {
}
})
this.isLoading = false
return
}
console.log(response)
const commentData = response.map((comment) => {
comment.showReplies = false

View File

@ -493,7 +493,8 @@ Comments:
Reply: Reply
There are no comments available for this video: There are no comments available
for this video
Load More Comments: Load More Comments
Load More Comments: Load More
No more comments available: No more comments available
Up Next: Up Next
# Toast Messages