Fix content warning label always showing in conversation main status

When the conversation was opened, the status state of the main status
would already be known, so the CW label wasn't getting updated or
hidden/shown.
This commit is contained in:
Shadowfacts 2019-11-28 21:22:13 -05:00
parent 7140590ccf
commit d5232c0b03
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 2 deletions

View File

@ -126,11 +126,12 @@ class BaseStatusTableViewCell: UITableViewCell {
contentLabel.statusID = statusID contentLabel.statusID = statusID
contentWarningLabel.text = status.spoilerText
contentWarningLabel.isHidden = status.spoilerText.isEmpty
if state.unknown { if state.unknown {
collapsible = !status.spoilerText.isEmpty collapsible = !status.spoilerText.isEmpty
var shouldCollapse = collapsible var shouldCollapse = collapsible
contentWarningLabel.text = status.spoilerText
contentWarningLabel.isHidden = status.spoilerText.isEmpty
if !shouldCollapse, if !shouldCollapse,
let text = contentLabel.text, let text = contentLabel.text,
text.count > 500 { text.count > 500 {