Merge branch 'master' of github.com:akatreyt/Planttime

This commit is contained in:
Trey t
2026-02-18 18:26:27 -06:00
2 changed files with 12 additions and 1 deletions

View File

@@ -290,8 +290,16 @@ final class PlantDetailViewModel {
// Find and update the task
if let index = schedule.tasks.firstIndex(where: { $0.id == task.id }) {
schedule.tasks[index] = task.completed()
let completedTask = task.completed()
schedule.tasks[index] = completedTask
careSchedule = schedule
// Persist the change to the repository
do {
try await careScheduleRepository.updateTask(completedTask)
} catch {
print("Failed to persist task completion: \(error)")
}
}
}

View File

@@ -77,6 +77,9 @@ struct TodayView: View {
.task {
await viewModel.loadTasks()
}
.onAppear {
Task { await viewModel.loadTasks() }
}
.refreshable {
await viewModel.loadTasks()
}