Replace showComments by minimizeComments in preferences

This commit is contained in:
Alexandre Moreau 2022-10-24 01:19:57 +02:00
parent 5a7f7c1f8d
commit ffc091131f
2 changed files with 9 additions and 11 deletions

View File

@ -66,11 +66,11 @@
@change="onChange($event)"
/>
</label>
<label class="pref" for="chkShowComments">
<strong v-t="'actions.show_comments'" />
<label class="pref" for="chkMinimizeComments">
<strong v-t="'actions.minimize_comments_default'" />
<input
id="chkShowComments"
v-model="showComments"
id="chkMinimizeComments"
v-model="minimizeComments"
class="checkbox"
type="checkbox"
@change="onChange($event)"
@ -365,7 +365,7 @@ export default {
countryMap: CountryMap,
countrySelected: "US",
defaultHomepage: "trending",
showComments: true,
minimizeComments: false,
minimizeDescription: false,
minimizeRecommendations: false,
watchHistory: false,
@ -501,7 +501,7 @@ export default {
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
this.countrySelected = this.getPreferenceString("region", "US");
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
this.showComments = this.getPreferenceBoolean("comments", true);
this.minimizeComments = this.getPreferenceBoolean("minimizeComments", true);
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
this.minimizeRecommendations = this.getPreferenceBoolean("minimizeRecommendations", false);
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
@ -560,7 +560,7 @@ export default {
localStorage.setItem("bufferGoal", this.bufferingGoal);
localStorage.setItem("region", this.countrySelected);
localStorage.setItem("homepage", this.defaultHomepage);
localStorage.setItem("comments", this.showComments);
localStorage.setItem("minimizeComments", this.minimizeComments);
localStorage.setItem("minimizeDescription", this.minimizeDescription);
localStorage.setItem("minimizeRecommendations", this.minimizeRecommendations);
localStorage.setItem("watchHistory", this.watchHistory);

View File

@ -277,9 +277,6 @@ export default {
year: "numeric",
});
},
commentsEnabled() {
return this.getPreferenceBoolean("comments", true);
},
},
mounted() {
// check screen size
@ -327,7 +324,7 @@ export default {
this.index = Number(this.$route.query.index);
this.getPlaylistData();
this.getSponsors();
if (!this.isEmbed && this.commentsEnabled) this.getComments();
if (!this.isEmbed && this.showComments) this.getComments();
window.addEventListener("resize", () => {
this.smallView = this.smallViewQuery.matches;
});
@ -335,6 +332,7 @@ export default {
activated() {
this.active = true;
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false);
this.showComments = !this.getPreferenceBoolean("minimizeComments", false);
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", false);
this.showRecs = !this.getPreferenceBoolean("minimizeRecommendations", false);
if (this.video.duration) {