vertical chapters with images are always collapsed

This commit is contained in:
Toni Förster 2023-11-27 12:13:51 +01:00
parent a7baaeb485
commit 8f08674527
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7

View File

@ -15,7 +15,8 @@ struct ChaptersView: View {
}
var body: some View {
if expand && !chapters.isEmpty {
if !chapters.isEmpty {
if expand || chaptersHaveImages {
#if os(tvOS)
List {
Section {
@ -38,18 +39,13 @@ struct ChaptersView: View {
}
.frame(minHeight: ChapterView.thumbnailHeight + 100)
} else {
Section {
ForEach(chapters) { chapter in
ChapterView(chapter: chapter)
}
}
.padding(.horizontal)
contents
}
#endif
} else if !chapters.isEmpty {
} else {
#if os(iOS)
Button(action: {
self.expand.toggle() // Use your expanding logic here
self.expand.toggle()
}) {
contents
}
@ -58,6 +54,7 @@ struct ChaptersView: View {
#endif
}
}
}
var contents: some View {
Section {