Reduce view hierarchy manipulation

This commit is contained in:
Justin Mazzocchi 2021-02-28 15:30:16 -08:00
parent a12d2eb17d
commit fbfebd240e
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -423,11 +423,10 @@ private extension StatusView {
viewModel.accountViewModel.displayName)
sideStackView.isHidden = isContextParent
avatarImageView.removeFromSuperview()
if isContextParent {
if isContextParent, avatarImageView.superview !== nameAccountContainerStackView {
nameAccountContainerStackView.insertArrangedSubview(avatarImageView, at: 0)
} else {
} else if avatarImageView.superview !== sideStackView {
sideStackView.insertArrangedSubview(avatarImageView, at: 1)
}