Improve temperature accuracy and layout

This commit is contained in:
Christoph Hagen
2023-08-09 17:13:53 +02:00
parent d1a24b581d
commit dfa9f716d4
6 changed files with 16 additions and 10 deletions

View File

@ -167,9 +167,12 @@ final class PersistentStorage: ObservableObject {
}
func removeMeasurements(for dateIndex: Int) {
defer { saveDailyCounts() }
let fileUrl = fileUrl(for: dateIndex)
guard fm.fileExists(atPath: fileUrl.path) else {
log.warning("No measurements for \(fileUrl.lastPathComponent)")
dailyMeasurementCounts = dailyMeasurementCounts.filter { $0.dateIndex != dateIndex }
recentMeasurements = recentMeasurements.filter { $0.date.dateIndex != dateIndex }
return
}
do {