|
|
|
@ -179,6 +179,7 @@ public class StoredCollection<T: Storable>: SomeCollection { |
|
|
|
if FileManager.default.fileExists(atPath: fileURL.path()) { |
|
|
|
if FileManager.default.fileExists(atPath: fileURL.path()) { |
|
|
|
let jsonString: String = try FileUtils.readFile(fileURL: fileURL) |
|
|
|
let jsonString: String = try FileUtils.readFile(fileURL: fileURL) |
|
|
|
let decoded: [T] = try jsonString.decodeArray() ?? [] |
|
|
|
let decoded: [T] = try jsonString.decodeArray() ?? [] |
|
|
|
|
|
|
|
self.hasLoaded = true // avoid pending management |
|
|
|
self.setItems(decoded) |
|
|
|
self.setItems(decoded) |
|
|
|
} |
|
|
|
} |
|
|
|
await MainActor.run { |
|
|
|
await MainActor.run { |
|
|
|
|