From fbfebd240eb781d78f5a2c92915ea82e722cf374 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Sun, 28 Feb 2021 15:30:16 -0800 Subject: [PATCH] Reduce view hierarchy manipulation --- Views/UIKit/Content Views/StatusView.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Views/UIKit/Content Views/StatusView.swift b/Views/UIKit/Content Views/StatusView.swift index fc54b50..5fdf26a 100644 --- a/Views/UIKit/Content Views/StatusView.swift +++ b/Views/UIKit/Content Views/StatusView.swift @@ -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) }