Make status spoiler text non-optional again
This commit is contained in:
parent
a2a2feef58
commit
bd81c81500
|
@ -27,7 +27,7 @@ public class Status: Decodable {
|
|||
public let favourited: Bool?
|
||||
public let muted: Bool?
|
||||
public let sensitive: Bool
|
||||
public let spoilerText: String?
|
||||
public let spoilerText: String
|
||||
public let visibility: Visibility
|
||||
public let attachments: [Attachment]
|
||||
public let mentions: [Mention]
|
||||
|
|
|
@ -131,14 +131,13 @@ class ComposeViewController: UIViewController {
|
|||
contentWarningEnabled = false
|
||||
contentWarningContainerView.isHidden = true
|
||||
} else {
|
||||
contentWarningEnabled = inReplyTo.spoilerText != nil && !inReplyTo.spoilerText!.isEmpty
|
||||
contentWarningEnabled = !inReplyTo.spoilerText.isEmpty
|
||||
contentWarningContainerView.isHidden = !contentWarningEnabled
|
||||
if Preferences.shared.contentWarningCopyMode == .prependRe,
|
||||
let spoiler = inReplyTo.spoilerText,
|
||||
!spoiler.lowercased().starts(with: "re:") {
|
||||
contentWarningTextField.text = "re: \(spoiler)"
|
||||
!inReplyTo.spoilerText.lowercased().starts(with: "re:") {
|
||||
contentWarningTextField.text = "re: \(inReplyTo.spoilerText)"
|
||||
} else {
|
||||
contentWarningTextField.text = inReplyTo.spoilerText != nil ? inReplyTo.spoilerText : ""
|
||||
contentWarningTextField.text = inReplyTo.spoilerText
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -126,10 +126,10 @@ class ConversationMainStatusTableViewCell: UITableViewCell {
|
|||
|
||||
contentLabel.statusID = statusID
|
||||
|
||||
collapsible = status.spoilerText != nil && !status.spoilerText!.isEmpty
|
||||
collapsible = !status.spoilerText.isEmpty
|
||||
setCollapsed(collapsible, animated: false)
|
||||
contentWarningLabel.text = status.spoilerText
|
||||
contentWarningLabel.isHidden = status.spoilerText != nil && status.spoilerText!.isEmpty
|
||||
contentWarningLabel.isHidden = status.spoilerText.isEmpty
|
||||
}
|
||||
|
||||
private func updateStatusState(status: Status) {
|
||||
|
|
|
@ -135,10 +135,10 @@ class StatusTableViewCell: UITableViewCell {
|
|||
|
||||
contentLabel.statusID = status.id
|
||||
|
||||
collapsible = status.spoilerText != nil && !status.spoilerText!.isEmpty
|
||||
collapsible = !status.spoilerText.isEmpty
|
||||
setCollapsed(collapsible, animated: false)
|
||||
contentWarningLabel.text = status.spoilerText
|
||||
contentWarningLabel.isHidden = status.spoilerText != nil && status.spoilerText!.isEmpty
|
||||
contentWarningLabel.isHidden = status.spoilerText.isEmpty
|
||||
}
|
||||
|
||||
private func updateStatusState(status: Status) {
|
||||
|
|
Loading…
Reference in New Issue