diff --git a/NucleicRemote/NucleicRemote/Models/SessionCache.swift b/NucleicRemote/NucleicRemote/Models/SessionCache.swift index 21b0b09..2b7b566 100644 --- a/NucleicRemote/NucleicRemote/Models/SessionCache.swift +++ b/NucleicRemote/NucleicRemote/Models/SessionCache.swift @@ -68,7 +68,7 @@ enum SessionCache { guard let root, let url = summariesURL, let dir = transcriptsDir else { return } try? FileManager.default.createDirectory(at: root, withIntermediateDirectories: true) let kept = Array(summaries.sorted { $0.updatedAt > $1.updatedAt }.prefix(sessionLimit)) - if let data = try? encoder.encode(kept) { try? data.write(to: url, options: .atomic) } + if let data = try? JSONEncoder().encode(kept) { try? data.write(to: url, options: .atomic) } // Drop transcript files for sessions that fell out of the recent set. let keep = Set(kept.map(transcriptFileName)) if let files = try? FileManager.default.contentsOfDirectory(