Remove live chat comments after 150 comments to better scroll through chat.

This commit is contained in:
Preston 2020-10-16 23:01:32 -04:00
parent 407449ac65
commit ce3bde6712

View File

@ -180,6 +180,7 @@ export default Vue.extend({
}
this.comments.push(comment)
console.log(this.comments.length)
if (typeof (comment.superchat) !== 'undefined') {
this.$store.dispatch('getRandomColorClass').then((data) => {
@ -211,6 +212,10 @@ export default Vue.extend({
if (this.stayAtBottom) {
liveChatComments.animate({ scrollTop: liveChatComments.prop('scrollHeight') })
}
if (this.comments.length > 150) {
this.comments = this.comments.splice(this.comments.length - 150, this.comments.length)
}
},
removeFromSuperChat: function (id) {