fix crash when updating an existing entry

code clean up
This commit is contained in:
Trey t
2022-03-03 09:45:46 -06:00
parent 746337b6a2
commit 348229fe60
7 changed files with 20 additions and 52 deletions

View File

@@ -52,12 +52,11 @@ class HomeViewViewModel: ObservableObject {
}
private func getGroupedData(addMonthStartWeekdayPadding: Bool) {
grouped = PersistenceController.shared.splitIntoYearMonth()
var newStuff = PersistenceController.shared.splitIntoYearMonth()
if addMonthStartWeekdayPadding {
grouped = MoodEntryFunctions.padMoodEntriesForCalendar(entries: grouped)
newStuff = MoodEntryFunctions.padMoodEntriesForCalendar(entries: grouped)
}
//
grouped = newStuff
numberOfItems = numberOfEntries
}