fix: layout, 409 handling, edit habits/tasks/savings
This commit is contained in:
@@ -209,6 +209,15 @@ struct DashboardView: View {
|
||||
recentlyLoggedHabitLogDate = today
|
||||
await loadData(refresh: true)
|
||||
scheduleUndoClear()
|
||||
} catch APIError.serverError(let code, _) where code == 409 {
|
||||
await MainActor.run {
|
||||
if let idx = todayHabits.firstIndex(where: { $0.id == habit.id }) {
|
||||
todayHabits[idx].completedToday = true
|
||||
}
|
||||
recentlyLoggedHabitId = habit.id
|
||||
recentlyLoggedHabitLogDate = today
|
||||
}
|
||||
scheduleUndoClear()
|
||||
} catch {
|
||||
errorMessage = error.localizedDescription; showError = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user