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
|
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
|
||||||
|
|
Loading…
Reference in New Issue