fix: notification always trigger scroll-to-top issue
This commit is contained in:
parent
9e5d7836ee
commit
37df2fbd45
|
@ -93,6 +93,7 @@ extension NotificationViewController {
|
|||
.receive(on: RunLoop.main)
|
||||
.sink { [weak self] in
|
||||
guard let self = self else { return }
|
||||
guard self.viewModel.needsScrollToTopAfterDataSourceUpdate else { return }
|
||||
self.viewModel.needsScrollToTopAfterDataSourceUpdate = false
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33) {
|
||||
self.scrollToTop(animated: true)
|
||||
|
@ -107,6 +108,9 @@ extension NotificationViewController {
|
|||
guard let self = self else { return }
|
||||
self.segmentControl.selectedSegmentIndex = segment.rawValue
|
||||
|
||||
// trigger scroll-to-top after data reload
|
||||
self.viewModel.needsScrollToTopAfterDataSourceUpdate = true
|
||||
|
||||
guard let domain = self.viewModel.activeMastodonAuthenticationBox.value?.domain, let userID = self.viewModel.activeMastodonAuthenticationBox.value?.userID else {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue