Skip to content

Commit 9c03950

Browse files
committed
refactor: MainViewCoordinator에서 PushNotificationViewModel 제거
1 parent 8f132fb commit 9c03950

2 files changed

Lines changed: 0 additions & 30 deletions

File tree

Application/DevLogPresentation/Sources/Main/MainView.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct MainView: View {
4949
} else if newValue == .today {
5050
todayViewCoordinator.fetchData()
5151
} else if newValue == .notification {
52-
coordinator.fetchData()
5352
} else if newValue == .profile {
5453
profileViewCoordinator.fetchData()
5554
}
@@ -126,17 +125,11 @@ struct MainView: View {
126125
mainSidebar
127126
} content: {
128127
PushNotificationListView(
129-
viewModel: coordinator.pushNotificationListViewModel,
130-
todoIdToPresent: todoIdToPresent,
131128
isCompactLayout: isCompactLayout
132129
)
133130
} detail: {
134131
Group {
135-
if let todoId = coordinator.todoIdToPresent?.id {
136132
TodoDetailView(
137-
viewModel: coordinator.todoDetailViewModel(
138-
todoId: todoId,
139-
showEditButton: false
140133
)
141134
)
142135
.id(todoId)
@@ -326,8 +319,6 @@ struct MainView: View {
326319

327320
private var notificationView: some View {
328321
PushNotificationListView(
329-
viewModel: coordinator.pushNotificationListViewModel,
330-
todoIdToPresent: todoIdToPresent,
331322
isCompactLayout: isCompactLayout
332323
)
333324
}
@@ -360,13 +351,6 @@ private extension MainView {
360351
)
361352
}
362353

363-
var todoIdToPresent: Binding<TodoIdItem?> {
364-
Binding(
365-
get: { coordinator.todoIdToPresent },
366-
set: { coordinator.todoIdToPresent = $0 }
367-
)
368-
}
369-
370354
var homeNavigationPath: Binding<[HomeRoute]> {
371355
Binding(
372356
get: { homeViewCoordinator.router.path },

Application/DevLogPresentation/Sources/Main/MainViewCoordinator.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import DevLogDomain
1313
@Observable
1414
final class MainViewCoordinator {
1515
let mainViewModel: MainViewModel
16-
let pushNotificationListViewModel: PushNotificationListViewModel
17-
var todoIdToPresent: TodoIdItem?
1816
private let diContainer: DIContainer
1917
@ObservationIgnored
2018
private var todoListViewModel: TodoListViewModel?
@@ -27,18 +25,6 @@ final class MainViewCoordinator {
2725
trackAnalyticsEventUseCase: container.resolve(TrackAnalyticsEventUseCase.self),
2826
unreadPushCountUseCase: container.resolve(ObserveUnreadPushCountUseCase.self)
2927
)
30-
self.pushNotificationListViewModel = PushNotificationListViewModel(
31-
fetchUseCase: container.resolve(FetchPushNotificationsUseCase.self),
32-
deleteUseCase: container.resolve(DeletePushNotificationUseCase.self),
33-
undoDeleteUseCase: container.resolve(UndoDeletePushNotificationUseCase.self),
34-
toggleReadUseCase: container.resolve(TogglePushNotificationReadUseCase.self),
35-
fetchQueryUseCase: container.resolve(FetchPushNotificationQueryUseCase.self),
36-
updateQueryUseCase: container.resolve(UpdatePushNotificationQueryUseCase.self)
37-
)
38-
}
39-
40-
func fetchData() {
41-
pushNotificationListViewModel.send(.fetchNotifications)
4228
}
4329

4430
func todoListViewModel(category: TodoCategory) -> TodoListViewModel {

0 commit comments

Comments
 (0)