Don't update constraints from StatusContentContainer.setCollapsed

This commit is contained in:
Shadowfacts 2023-05-14 15:53:24 -04:00
parent 421cb7ba03
commit 3b965b92f2
1 changed files with 6 additions and 5 deletions

View File

@ -130,11 +130,12 @@ class StatusContentContainer<ContentView: ContentTextView, PollView: StatusConte
} }
isCollapsed = collapsed isCollapsed = collapsed
// ensure that we have a lastSubviewBottomConstraint // don't call setNeedsUpdateConstraints b/c that destroys/recreates a bunch of other constraints
updateConstraintsIfNeeded() // if there is no lastSubviewBottomConstraint, then we already need a constraint update, so we don't need to do anything here
// force unwrap because the content container should always have at least one view if let lastSubviewBottomConstraint {
lastSubviewBottomConstraint!.isActive = !collapsed lastSubviewBottomConstraint.isActive = !collapsed
zeroHeightConstraint.isActive = collapsed zeroHeightConstraint.isActive = collapsed
}
} }
// used only for collapsing automatically based on height, doesn't need to be accurate // used only for collapsing automatically based on height, doesn't need to be accurate