fix: notification list always reload issue

This commit is contained in:
CMK 2021-07-09 19:13:09 +08:00
parent 0dacea6326
commit 6a2fee12b5
1 changed files with 4 additions and 2 deletions

View File

@ -148,8 +148,10 @@ extension NotificationViewController {
tableView.deselectRow(with: transitionCoordinator, animated: animated)
// fetch latest notification when will appear
viewModel.loadLatestStateMachine.enter(NotificationViewModel.LoadLatestState.Loading.self)
// fetch latest notification when scroll position is within half screen height to prevent list reload
if tableView.contentOffset.y < view.frame.height * 0.5 {
viewModel.loadLatestStateMachine.enter(NotificationViewModel.LoadLatestState.Loading.self)
}
// needs trigger manually after onboarding dismiss