@@ -14,6 +14,7 @@ struct MainView: View {
1414 @State private var coordinator : MainViewCoordinator
1515 @State private var homeViewCoordinator : HomeViewCoordinator
1616 @State private var todayViewCoordinator : TodayViewCoordinator
17+ @State private var pushNotificationListViewCoordinator : PushNotificationListViewCoordinator
1718 @State private var profileViewCoordinator : ProfileViewCoordinator
1819 @Binding var selectedTab : MainTab ?
1920
@@ -24,6 +25,9 @@ struct MainView: View {
2425 self . _coordinator = State ( initialValue: MainViewCoordinator ( container: container) )
2526 self . _homeViewCoordinator = State ( initialValue: HomeViewCoordinator ( container: container) )
2627 self . _todayViewCoordinator = State ( initialValue: TodayViewCoordinator ( container: container) )
28+ self . _pushNotificationListViewCoordinator = State (
29+ initialValue: PushNotificationListViewCoordinator ( container: container)
30+ )
2731 self . _profileViewCoordinator = State ( initialValue: ProfileViewCoordinator ( container: container) )
2832 self . _selectedTab = selectedTab
2933 }
@@ -49,6 +53,7 @@ struct MainView: View {
4953 } else if newValue == . today {
5054 todayViewCoordinator. fetchData ( )
5155 } else if newValue == . notification {
56+ pushNotificationListViewCoordinator. fetchData ( )
5257 } else if newValue == . profile {
5358 profileViewCoordinator. fetchData ( )
5459 }
@@ -125,11 +130,15 @@ struct MainView: View {
125130 mainSidebar
126131 } content: {
127132 PushNotificationListView (
133+ coordinator: pushNotificationListViewCoordinator,
128134 isCompactLayout: isCompactLayout
129135 )
130136 } detail: {
131137 Group {
138+ if let todoId = pushNotificationListViewCoordinator. todoIdToPresent? . id {
132139 TodoDetailView (
140+ viewModel: pushNotificationListViewCoordinator. makeTodoDetailViewModel (
141+ todoId: todoId
133142 )
134143 )
135144 . id ( todoId)
@@ -319,6 +328,7 @@ struct MainView: View {
319328
320329 private var notificationView : some View {
321330 PushNotificationListView (
331+ coordinator: pushNotificationListViewCoordinator,
322332 isCompactLayout: isCompactLayout
323333 )
324334 }
0 commit comments