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