diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift index 2e62a58c0..164f92c88 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift @@ -590,7 +590,15 @@ extension HomeTimelineViewController { return true } } - + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + guard (scrollView.safeAreaInsets.top + scrollView.contentOffset.y) == 0 else { + return + } + + hideTimelinePill() + } + private func savePositionBeforeScrollToTop() { // check save action interval // should not fast than 0.5s to prevent save when scrollToTop on-flying diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift index dddae7a85..bf343bc4d 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewModel+LoadLatestState.swift @@ -160,7 +160,7 @@ extension HomeTimelineViewModel.LoadLatestState { FeedbackGenerator.shared.generate(.impact(.light)) } - if newStatuses.isNotEmpty { + if newStatuses.isNotEmpty && (previousState is HomeTimelineViewModel.LoadLatestState.ContextSwitch) == false { viewModel.hasNewPosts.value = true }