Fix 💊-Issues (#1278)

* Remove pill after scrolling to top (#1275)

* Don't show pill after switching timelines (#1275)
This commit is contained in:
Nathan Mattes 2024-04-23 09:39:33 +02:00 committed by GitHub
parent 235499ec10
commit cdced03c27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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
}