diff --git a/iosApp/iosApp/Profile/NotificationPreferencesView.swift b/iosApp/iosApp/Profile/NotificationPreferencesView.swift index 8a3266e..95c5a73 100644 --- a/iosApp/iosApp/Profile/NotificationPreferencesView.swift +++ b/iosApp/iosApp/Profile/NotificationPreferencesView.swift @@ -562,11 +562,21 @@ struct NotificationTimePickerRow: View { // MARK: - TimePickerSheet struct TimePickerSheet: View { - @State var selectedHour: Int + @State private var selectedHour: Int let onSave: (Int) -> Void let onCancel: () -> Void let formatHour: (Int) -> String + // Pre-computed hours array to avoid range issues with wheel picker + private let hours: [Int] = Array(0..<24) + + init(selectedHour: Int, onSave: @escaping (Int) -> Void, onCancel: @escaping () -> Void, formatHour: @escaping (Int) -> String) { + _selectedHour = State(initialValue: selectedHour) + self.onSave = onSave + self.onCancel = onCancel + self.formatHour = formatHour + } + var body: some View { NavigationStack { VStack(spacing: 24) { @@ -576,7 +586,7 @@ struct TimePickerSheet: View { .padding(.top) Picker("Hour", selection: $selectedHour) { - ForEach(0..<24, id: \.self) { hour in + ForEach(hours, id: \.self) { hour in Text(formatHour(hour)) .tag(hour) } diff --git a/iosApp/iosApp/Residence/ResidencesListView.swift b/iosApp/iosApp/Residence/ResidencesListView.swift index 28d1413..7a97c85 100644 --- a/iosApp/iosApp/Residence/ResidencesListView.swift +++ b/iosApp/iosApp/Residence/ResidencesListView.swift @@ -24,7 +24,7 @@ struct ResidencesListView: View { errorMessage: viewModel.errorMessage, content: { residences in ResidencesContent( - summary: viewModel.totalSummary ?? TotalSummary(totalResidences: Int32(residences.count), totalTasks: 0, totalOverdue: 0, totalDueSoon: 0, totalPending: 0, tasksDueNextWeek: 0, tasksDueNextMonth: 0), + summary: viewModel.totalSummary ?? TotalSummary(totalResidences: Int32(residences.count), totalTasks: 0, totalPending: 0, totalOverdue: 0, tasksDueNextWeek: 0, tasksDueNextMonth: 0), residences: residences ) }, diff --git a/iosApp/iosApp/Subviews/Task/TasksSection.swift b/iosApp/iosApp/Subviews/Task/TasksSection.swift index 0e5cca2..3f5b755 100644 --- a/iosApp/iosApp/Subviews/Task/TasksSection.swift +++ b/iosApp/iosApp/Subviews/Task/TasksSection.swift @@ -185,7 +185,7 @@ struct SwipeHintView: View { ) ], daysThreshold: 30, - residenceId: "1", summary: nil + residenceId: "1" ), onEditTask: { _ in }, onCancelTask: { _ in }, diff --git a/iosApp/iosApp/Task/TaskViewModel.swift b/iosApp/iosApp/Task/TaskViewModel.swift index 4b3f986..1f0aa8b 100644 --- a/iosApp/iosApp/Task/TaskViewModel.swift +++ b/iosApp/iosApp/Task/TaskViewModel.swift @@ -402,7 +402,7 @@ class TaskViewModel: ObservableObject { tasksResponse = TaskColumnsResponse( columns: newColumns, daysThreshold: currentResponse.daysThreshold, - residenceId: currentResponse.residenceId, summary: nil + residenceId: currentResponse.residenceId ) } @@ -430,7 +430,7 @@ class TaskViewModel: ObservableObject { tasksResponse = TaskColumnsResponse( columns: newColumns, daysThreshold: currentResponse.daysThreshold, - residenceId: currentResponse.residenceId, summary: nil + residenceId: currentResponse.residenceId ) }