From 76e9482f35d05dcc21b905a603c7425256b20315 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 19 Jul 2021 01:57:34 +0530 Subject: [PATCH] Add ability to disable showing comments. --- src/components/Preferences.vue | 7 +++++++ src/components/WatchVideo.vue | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Preferences.vue b/src/components/Preferences.vue index 76c6f3fb..5a4ae0c5 100644 --- a/src/components/Preferences.vue +++ b/src/components/Preferences.vue @@ -74,6 +74,10 @@ +
+ Show Comments +
+

Instances List

@@ -131,6 +135,7 @@ export default { countryMap: CountryMap.COUNTRIES, country: "US", defaultHomepage: "trending", + showComments: true, }; }, mounted() { @@ -202,6 +207,7 @@ export default { this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10); this.country = this.getPreferenceString("region", "US"); this.defaultHomepage = this.getPreferenceString("homepage", "trending"); + this.showComments = this.getPreferenceBoolean("comments", true); } }, methods: { @@ -231,6 +237,7 @@ export default { localStorage.setItem("bufferGoal", this.bufferingGoal); localStorage.setItem("region", this.country); localStorage.setItem("homepage", this.defaultHomepage); + localStorage.setItem("comments", this.showComments); if (shouldReload) window.location.reload(); } diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 094e391f..2f9d20d0 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -150,7 +150,7 @@ export default { this.$refs.videoPlayer.loadVideo(); }); this.getSponsors(); - this.getComments(); + if (this.getPreferenceBoolean("comments", true)) this.getComments(); }, activated() { this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", true);