History UI improvements
This commit is contained in:
@@ -107,6 +107,15 @@ class BrowserHistory
|
||||
}
|
||||
}
|
||||
|
||||
public func clearAllHistory() {
|
||||
let dataContext = persistentContainer.viewContext
|
||||
let fetchRequest: NSFetchRequest<NSFetchRequestResult> = HistoryItemEntity.fetchRequest()
|
||||
let request = NSBatchDeleteRequest(fetchRequest: fetchRequest)
|
||||
|
||||
do { try dataContext.execute(request) }
|
||||
catch { print("Error clearing history: \(error.localizedDescription)") }
|
||||
}
|
||||
|
||||
public func allHistory(filteredBy filterString: String? = nil, limit: Int = 500) -> [HistoryItem] {
|
||||
let dataContext = persistentContainer.viewContext
|
||||
let fetchRequest = fetchRequest(forStringContaining: filterString, limit: limit)
|
||||
|
||||
Reference in New Issue
Block a user