HistoryView: Adds ability to delete history items

This commit is contained in:
2023-01-25 15:04:58 -08:00
parent 53efb5389e
commit 34ca35ea5a
5 changed files with 138 additions and 46 deletions

View File

@@ -12,13 +12,13 @@ struct HistoryItem: Hashable, Identifiable
var url: URL
var title: String
var lastVisited: Date
var id: ObjectIdentifier
var id: NSManagedObjectID
init(entity: HistoryItemEntity) {
self.url = entity.url ?? URL(string: "about:blank")!
self.lastVisited = entity.lastVisited ?? Date()
self.title = entity.title ?? ""
self.id = entity.id
self.id = entity.objectID
}
// For testing/previews
@@ -26,6 +26,6 @@ struct HistoryItem: Hashable, Identifiable
self.url = url
self.title = title
self.lastVisited = lastVisited
self.id = ObjectIdentifier(NSUUID())
self.id = NSManagedObjectID()
}
}