Fix crash when sidebar collapses

This commit is contained in:
Shadowfacts 2020-12-14 22:23:22 -05:00
parent 56b51f944d
commit c7b708e62b
1 changed files with 4 additions and 2 deletions

View File

@ -78,8 +78,6 @@ class ProfileViewController: UIPageViewController {
}
navigationItem.rightBarButtonItem = composeButton
userActivity = UserActivityManager.showProfileActivity(id: accountID!, accountID: mastodonController.accountInfo!.id)
headerView = ProfileHeaderView.create()
headerView.delegate = self
@ -132,6 +130,10 @@ class ProfileViewController: UIPageViewController {
return
}
if let currentAccountID = mastodonController.accountInfo?.id {
userActivity = UserActivityManager.showProfileActivity(id: accountID, accountID: currentAccountID)
}
// Optionally invoke updateUI on headerView because viewDidLoad may not have been called yet
headerView?.updateUI(for: accountID)
navigationItem.title = account.displayNameWithoutCustomEmoji