Fix no content message incorrectly appearing on profiles

Caused by a spurious appearance transition from embedChild
This commit is contained in:
Shadowfacts 2023-02-25 15:30:30 -05:00
parent 3d9477f0c9
commit 0c0180264e
1 changed files with 9 additions and 1 deletions

View File

@ -161,7 +161,15 @@ class ProfileViewController: UIViewController, StateRestorableViewController {
// if old doesn't exist, we're selecting the initial view controller, so moving the header around isn't necessary // if old doesn't exist, we're selecting the initial view controller, so moving the header around isn't necessary
new.initialHeaderMode = .createView new.initialHeaderMode = .createView
new.view.translatesAutoresizingMaskIntoConstraints = false new.view.translatesAutoresizingMaskIntoConstraints = false
embedChild(new) addChild(new)
view.addSubview(new.view)
NSLayoutConstraint.activate([
new.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
new.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
new.view.topAnchor.constraint(equalTo: view.topAnchor),
new.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
])
new.didMove(toParent: self)
self.currentIndex = index self.currentIndex = index
state = .idle state = .idle
completion?(true) completion?(true)