From ce3bde67124ad4520be13df804dc2773bb257efa Mon Sep 17 00:00:00 2001 From: Preston Date: Fri, 16 Oct 2020 23:01:32 -0400 Subject: [PATCH] Remove live chat comments after 150 comments to better scroll through chat. --- .../watch-video-live-chat/watch-video-live-chat.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js b/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js index c85e019c..9d8be663 100644 --- a/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js +++ b/src/renderer/components/watch-video-live-chat/watch-video-live-chat.js @@ -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) {