fix data getting pending when unnecessary

sync3
Laurent 5 months ago
parent 98f95eb73f
commit 5910bfffd4
  1. 1
      LeStorage/StoredCollection.swift

@ -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 {

Loading…
Cancel
Save