forked from shadowfacts/Tusker
Fix long status table view cells not getting collapsed
This commit is contained in:
parent
07c86b6949
commit
527706154a
|
@ -11,10 +11,10 @@ import Pachyderm
|
|||
|
||||
extension StatusState {
|
||||
|
||||
func resolveFor(status: StatusMO, height: CGFloat) {
|
||||
func resolveFor(status: StatusMO, height: CGFloat, textLength: Int? = nil) {
|
||||
let longEnoughToCollapse: Bool
|
||||
if Preferences.shared.collapseLongPosts,
|
||||
height > 500 {
|
||||
height > 500 || (textLength != nil && textLength! > 500) {
|
||||
longEnoughToCollapse = true
|
||||
} else {
|
||||
longEnoughToCollapse = false
|
||||
|
|
|
@ -182,8 +182,8 @@ class BaseStatusTableViewCell: UITableViewCell {
|
|||
updateStatusIconsForPreferences(status)
|
||||
|
||||
if state.unknown {
|
||||
layoutIfNeeded()
|
||||
state.resolveFor(status: status, height: contentTextView.bounds.height)
|
||||
// for some reason the height here can't be computed correctly, so we fallback to the old hack of just considering raw length
|
||||
state.resolveFor(status: status, height: 0, textLength: contentTextView.attributedText.length)
|
||||
if state.collapsible! && showStatusAutomatically {
|
||||
state.collapsed = false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue