Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include hide comment photos setting #3939

Merged
merged 6 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export default defineComponent({
hideComments: function () {
return this.$store.getters.getHideComments
},
hideLiveStreams: function() {
hideCommentPhotos: function () {
return this.$store.getters.getHideCommentPhotos
},
hideLiveStreams: function () {
return this.$store.getters.getHideLiveStreams
},
hideUpcomingPremieres: function () {
Expand All @@ -62,31 +65,31 @@ export default defineComponent({
hideChapters: function () {
return this.$store.getters.getHideChapters
},
hideFeaturedChannels: function() {
hideFeaturedChannels: function () {
return this.$store.getters.getHideFeaturedChannels
},
hideChannelShorts: function() {
hideChannelShorts: function () {
return this.$store.getters.getHideChannelShorts
},
hideChannelPlaylists: function() {
hideChannelPlaylists: function () {
return this.$store.getters.getHideChannelPlaylists
},
hideChannelPodcasts: function() {
hideChannelPodcasts: function () {
return this.$store.getters.getHideChannelPodcasts
},
hideChannelReleases: function() {
hideChannelReleases: function () {
return this.$store.getters.getHideChannelReleases
},
hideChannelCommunity: function() {
hideChannelCommunity: function () {
return this.$store.getters.getHideChannelCommunity
},
hideSubscriptionsVideos: function() {
hideSubscriptionsVideos: function () {
return this.$store.getters.getHideSubscriptionsVideos
},
hideSubscriptionsShorts: function() {
hideSubscriptionsShorts: function () {
return this.$store.getters.getHideSubscriptionsShorts
},
hideSubscriptionsLive: function() {
hideSubscriptionsLive: function () {
return this.$store.getters.getHideSubscriptionsLive
},
showDistractionFreeTitles: function () {
Expand All @@ -111,7 +114,7 @@ export default defineComponent({

this.updateHideRecommendedVideos(value)
},
handleChannelsHidden: function(value) {
handleChannelsHidden: function (value) {
this.updateChannelsHidden(JSON.stringify(value))
},

Expand All @@ -130,6 +133,7 @@ export default defineComponent({
'updateDefaultTheatreMode',
'updateHideVideoDescription',
'updateHideComments',
'updateHideCommentPhotos',
'updateHideLiveStreams',
'updateHideUpcomingPremieres',
'updateHideSharingActions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
:default-value="hideComments"
@change="updateHideComments"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Profile Pictures in Comments')"
:compact="true"
:default-value="hideCommentPhotos"
@change="updateHideCommentPhotos"
/>
</div>
</div>
<h4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@
-webkit-border-radius: 200px;
}

.commentThumbnailHidden {
float: left;
display: flex;
justify-content: center;
align-items: center;
width: 60px;
height: 60px;
font-size: 20px;
line-height: 1em;
text-transform: capitalize;
color: rgb(0 0 0);
background-color: rgb(235 160 172);
border-radius: 50%;
-webkit-border-radius: 50%;
}

.commentAuthorWrapper {
font-weight: bold;
font-size: 14px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default defineComponent({
return this.$store.getters.getHideCommentLikes
},

hideCommentPhotos: function () {
return this.$store.getters.getHideCommentPhotos
},

commentAutoLoadEnabled: function () {
return this.$store.getters.getCommentAutoLoadEnabled
},
Expand All @@ -81,7 +85,7 @@ export default defineComponent({
return (this.sortNewest) ? 'newest' : 'top'
},

observeVisibilityOptions: function() {
observeVisibilityOptions: function () {
if (!this.commentAutoLoadEnabled) { return false }
if (!this.videoPlayerReady) { return false }

Expand All @@ -106,11 +110,11 @@ export default defineComponent({
}
},

canPerformInitialCommentLoading: function() {
canPerformInitialCommentLoading: function () {
return this.commentData.length === 0 && !this.isLoading && !this.showComments
},

canPerformMoreCommentLoading: function() {
canPerformMoreCommentLoading: function () {
return this.commentData.length > 0 && !this.isLoading && this.showComments && this.nextPageToken
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@
:to="`/channel/${comment.authorLink}`"
tabindex="-1"
>
<img
:src="comment.authorThumb"
alt=""
class="commentThumbnail"
>
<!-- Hide comment photo only if it isn't the video uploader -->
<template v-if="hideCommentPhotos && !comment.isOwner">
<div
class="commentThumbnailHidden"
>
{{ comment.author.substr(1, 1) }}
</div>
</template>
<template v-else>
<img
:src="comment.authorThumb"
alt=""
class="commentThumbnail"
>
</template>
</router-link>
<p
v-if="comment.isPinned"
Expand Down Expand Up @@ -167,11 +177,21 @@
:to="`/channel/${reply.authorLink}`"
tabindex="-1"
>
<img
:src="reply.authorThumb"
class="commentThumbnail"
alt=""
>
<!-- Hide comment photo only if it isn't the video uploader -->
<template v-if="hideCommentPhotos && !reply.isOwner">
<div
class="commentThumbnailHidden"
>
{{ reply.author.substr(1, 1) }}
</div>
</template>
<template v-else>
<img
:src="reply.authorThumb"
alt=""
class="commentThumbnail"
>
</template>
</router-link>
<p class="commentAuthorWrapper">
<router-link
Expand Down
1 change: 1 addition & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const state = {
hideChannelShorts: false,
hideChannelSubscriptions: false,
hideCommentLikes: false,
hideCommentPhotos: false,
hideComments: false,
hideFeaturedChannels: false,
channelsHidden: '[]',
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ Settings:
Hide Active Subscriptions: Hide Active Subscriptions
Hide Video Description: Hide Video Description
Hide Comments: Hide Comments
Hide Profile Pictures in Comments: Hide Profile Pictures in Comments
Display Titles Without Excessive Capitalisation: Display Titles Without Excessive Capitalisation
Hide Live Streams: Hide Live Streams
Hide Upcoming Premieres: Hide Upcoming Premieres
Expand Down