Skip to content

Commit b726b05

Browse files
committed
fix: PushNotification 데이터 fetch 시점을 탭 선택 상태 기준으로 변경
1 parent 45d346f commit b726b05

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Application/DevLogPresentation/Sources/Main/MainView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ struct MainView: View {
4848
homeViewCoordinator.fetchData()
4949
} else if newValue == .today {
5050
todayViewCoordinator.fetchData()
51+
} else if newValue == .notification {
52+
coordinator.fetchData()
5153
} else if newValue == .profile {
5254
profileViewCoordinator.fetchData()
5355
}

Application/DevLogPresentation/Sources/Main/MainViewCoordinator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ final class MainViewCoordinator {
3737
)
3838
}
3939

40+
func fetchData() {
41+
pushNotificationListViewModel.send(.fetchNotifications)
42+
}
43+
4044
func todoListViewModel(category: TodoCategory) -> TodoListViewModel {
4145
if let todoListViewModel,
4246
todoListViewModel.category == category {

Application/DevLogPresentation/Sources/PushNotification/PushNotificationListView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct PushNotificationListView: View {
2929
headerOffset = max(0, -offset)
3030
}
3131
.safeAreaInset(edge: .top) { safeAreaHeader }
32-
.onAppear { viewModel.send(.fetchNotifications) }
3332
.refreshable { viewModel.send(.fetchNotifications) }
3433
.navigationTitle(String(localized: "nav_push_notifications"))
3534
.listStyle(.plain)

0 commit comments

Comments
 (0)