mirror of
https://github.com/metabolist/metatext.git
synced 2024-05-09 12:02:53 +00:00
Compare commits
3 commits
3a5ebddad5
...
ce6d55042d
Author | SHA1 | Date | |
---|---|---|---|
ce6d55042d | |||
bdd63e2cfb | |||
0e46a0eb28 |
|
@ -55,6 +55,7 @@ final class MainNavigationViewController: UITabBarController {
|
|||
.store(in: &cancellables)
|
||||
|
||||
NotificationCenter.default.publisher(for: UIScene.willEnterForegroundNotification)
|
||||
.debounce(for: .seconds(Self.refreshFromBackgroundDebounceInterval), scheduler: DispatchQueue.main)
|
||||
.sink { [weak self] _ in self?.viewModel.refreshIdentity() }
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
@ -106,6 +107,7 @@ extension MainNavigationViewController: NavigationHandling {
|
|||
private extension MainNavigationViewController {
|
||||
static let secondaryNavigationViewTag = UUID().hashValue
|
||||
static let newStatusViewTag = UUID().hashValue
|
||||
static let refreshFromBackgroundDebounceInterval: TimeInterval = 30
|
||||
|
||||
func setupViewControllers(pending: Bool) {
|
||||
var controllers: [UIViewController] = [
|
||||
|
|
|
@ -23,6 +23,7 @@ class TableViewController: UITableViewController {
|
|||
private var shouldKeepPlayingVideoAfterDismissal = false
|
||||
private var newItemsViewHiddenConstraint: NSLayoutConstraint?
|
||||
private var newItemsViewVisibleConstraint: NSLayoutConstraint?
|
||||
private var isPastInitialAppearance = false
|
||||
private let insetBottom: Bool
|
||||
private weak var parentNavigationController: UINavigationController?
|
||||
|
||||
|
@ -103,7 +104,11 @@ class TableViewController: UITableViewController {
|
|||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
refreshIfAble()
|
||||
if isPastInitialAppearance {
|
||||
refreshIfAble()
|
||||
}
|
||||
|
||||
isPastInitialAppearance = true
|
||||
}
|
||||
|
||||
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
|
@ -872,8 +877,8 @@ private extension TableViewController {
|
|||
func hideNewItemsView() {
|
||||
UIView.animate(withDuration: .zeroIfReduceMotion(.defaultAnimationDuration)) {
|
||||
self.newItemsView.alpha = 0
|
||||
self.newItemsViewHiddenConstraint?.isActive = true
|
||||
self.newItemsViewVisibleConstraint?.isActive = false
|
||||
self.newItemsViewHiddenConstraint?.isActive = true
|
||||
self.view.layoutIfNeeded()
|
||||
} completion: { _ in
|
||||
self.reloadVisibleItems()
|
||||
|
|
Loading…
Reference in a new issue