Merge pull request #1232 from Bnyro/mobile

show comments as disabled by user if disabled in settings
This commit is contained in:
Kavin 2022-07-20 23:59:50 +05:30 committed by GitHub
commit 9c0f4e2d24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 5 deletions

View file

@ -158,11 +158,14 @@
<hr />
<div class="grid xl:grid-cols-5 sm:grid-cols-4 grid-cols-1">
<div v-if="!comments" class="xl:col-span-4 sm:col-span-3">
<p class="text-center mt-8">Comments are loading...</p>
<div v-if="!commentsEnabled" class="xl:col-span-4 sm:col-span-3">
<p class="text-center mt-8" v-t="'comment.user_disabled'"></p>
</div>
<div v-else-if="!comments" class="xl:col-span-4 sm:col-span-3">
<p class="text-center mt-8" v-t="'comment.loading'"></p>
</div>
<div v-else-if="comments.disabled" class="xl:col-span-4 sm:col-span-3">
<p class="text-center mt-8">Comments are turned off.</p>
<p class="text-center mt-8" v-t="'comment.disabled'"></p>
</div>
<div v-else ref="comments" class="xl:col-span-4 sm:col-span-3">
<CommentItem
@ -266,6 +269,9 @@ export default {
year: "numeric",
});
},
commentsEnabled() {
return this.getPreferenceBoolean("comments", true);
},
},
mounted() {
// check screen size
@ -313,7 +319,7 @@ export default {
this.index = Number(this.$route.query.index);
this.getPlaylistData();
this.getSponsors();
if (!this.isEmbed && this.getPreferenceBoolean("comments", true)) this.getComments();
if (!this.isEmbed && this.commentsEnabled) this.getComments();
window.addEventListener("resize", () => {
this.smallView = this.smallViewQuery.matches;
});

View file

@ -86,7 +86,10 @@
"minimize_recommendations_default": "Minimize Recommendations by default"
},
"comment": {
"pinned_by": "Pinned by"
"pinned_by": "Pinned by",
"disabled": "Comments are disabled by the uploader.",
"loading": "Comments are loading ...",
"user_disabled": "Comments are disabled in the settings."
},
"preferences": {
"instance_name": "Instance Name",