Recipe edit UI polish
This commit is contained in:
@@ -89,26 +89,5 @@ class DataStore {
|
||||
}
|
||||
}
|
||||
|
||||
// SimilarityIndex loading and saving
|
||||
import SimilaritySearchKit
|
||||
extension DataStore {
|
||||
func loadIndex() async -> [IndexItem]? {
|
||||
do {
|
||||
let indexItems = try await SimilarityIndex().loadIndex(fromDirectory: Self.fileURL(appending: "similarity_index"))
|
||||
return indexItems
|
||||
} catch {
|
||||
print("Unable to load SimilarityIndex")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func saveIndex(_ index: SimilarityIndex) {
|
||||
do {
|
||||
try index.saveIndex(toDirectory: Self.fileURL(appending: "similarity_index"))
|
||||
} catch {
|
||||
print("Unable to save SimilarityIndex")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user