Merge pull request #744 from stonerl/hide-comments

Allow hiding comments
This commit is contained in:
Arkadiusz Fal
2024-08-24 12:13:44 +02:00
committed by GitHub
5 changed files with 22 additions and 5 deletions

View File

@@ -203,6 +203,7 @@ struct VideoDetails: View {
@Default(.showChapterThumbnails) private var showChapterThumbnails
@Default(.showChapterThumbnailsOnlyWhenDifferent) private var showChapterThumbnailsOnlyWhenDifferent
@Default(.showRelated) private var showRelated
@Default(.showComments) private var showComments
#if !os(tvOS)
@Default(.showScrollToTopInComments) private var showScrollToTopInComments
#endif
@@ -300,6 +301,8 @@ struct VideoDetails: View {
switch page {
case .queue:
return !sidebarQueue && player.isAdvanceToNextItemAvailable
case .comments:
return showComments
default:
return !video.isLocal
}
@@ -378,10 +381,12 @@ struct VideoDetails: View {
PlayerQueueView(sidebarQueue: false)
.padding(.horizontal)
case .comments:
CommentsView()
.onAppear {
comments.loadIfNeeded()
}
if showComments {
CommentsView()
.onAppear {
comments.loadIfNeeded()
}
}
}
}
.padding(.bottom, 60)