Fix crash with library items that have no info

This commit is contained in:
Jackson Harper
2024-05-06 17:09:47 +08:00
parent 3c56d01c86
commit e407633eae
2 changed files with 5 additions and 4 deletions

View File

@ -38,7 +38,7 @@ enum LoadingBarStyle {
@Published var selectedLabels = [LinkedItemLabel]()
@Published var negatedLabels = [LinkedItemLabel]()
@Published var appliedSort = LinkedItemSort.newest.rawValue
@Published var digestIsUnread = false
@State var lastMoreFetched: Date?

View File

@ -284,10 +284,11 @@ public struct LibraryItemCard: View {
let texts = [savedAtText, estimatedReadingTimeText, readingProgressText, highlightsText, notesText]
.compactMap { $0 }
texts.dropLast().reduce(Text("")) { result, text in
if texts.count > 0 {
texts.dropLast().reduce(Text("")) { result, text in
result + text + Text("").font(.footnote).foregroundColor(Color.themeLibraryItemSubtle)
} + texts.last!
// .reduce(Text(""), +)
} + texts.last!
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}