fix crash where homeViewTwo view model wasnt being updated
This commit is contained in:
@@ -72,8 +72,8 @@ struct MonthDetailView: View {
|
||||
deleteEnabled,
|
||||
selectedEntry.mood != .missing {
|
||||
Button(String(localized: "content_view_delete_entry"), action: {
|
||||
updateEntries()
|
||||
PersistenceController.shared.update(entryDate: selectedEntry.forDate!, withModd: .missing)
|
||||
updateEntries()
|
||||
showUpdateEntryAlert = false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ class HomeViewViewModel: ObservableObject {
|
||||
self.getGroupedData(addMonthStartWeekdayPadding: self.addMonthStartWeekdayPadding)
|
||||
|
||||
}
|
||||
PersistenceController.shared.listeners.append { [weak self] in
|
||||
self?.updateData()
|
||||
}
|
||||
updateData()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user