Allow hiding comments

This commit is contained in:
Toni Förster
2024-08-20 20:38:18 +02:00
parent af75afa912
commit f5e509c091
5 changed files with 22 additions and 5 deletions

View File

@@ -189,6 +189,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
@@ -284,6 +285,8 @@ struct VideoDetails: View {
switch page {
case .queue:
return !sidebarQueue && player.isAdvanceToNextItemAvailable
case .comments:
return showComments
default:
return !video.isLocal
}
@@ -362,10 +365,12 @@ struct VideoDetails: View {
PlayerQueueView(sidebarQueue: false)
.padding(.horizontal)
case .comments:
CommentsView()
.onAppear {
comments.loadIfNeeded()
}
if showComments {
CommentsView()
.onAppear {
comments.loadIfNeeded()
}
}
}
}
.padding(.bottom, 60)