mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
sort highlights by createdAt
This commit is contained in:
parent
79875706e9
commit
cffdfa4342
2 changed files with 18 additions and 2 deletions
|
|
@ -37,7 +37,19 @@ struct HighlightsListCard: View {
|
|||
}
|
||||
|
||||
var addNoteSection: some View {
|
||||
Text("Tap to add a note")
|
||||
HStack {
|
||||
Image(systemName: "note.text.badge.plus").foregroundColor(.appGrayTextContrast)
|
||||
|
||||
Text("Add a Note")
|
||||
.font(.appSubheadline)
|
||||
.foregroundColor(.appGrayTextContrast)
|
||||
.lineLimit(1)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.onTapGesture {
|
||||
print("add a note")
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@ import Views
|
|||
@Published var highlights = [Highlight]()
|
||||
|
||||
func load(item: LinkedItem) {
|
||||
highlights = item.highlights.asArray(of: Highlight.self)
|
||||
let unsortedHighlights = item.highlights.asArray(of: Highlight.self)
|
||||
|
||||
highlights = unsortedHighlights.sorted {
|
||||
($0.createdAt ?? Date()) < ($1.createdAt ?? Date())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue