forked from shadowfacts/Tusker
Fix requires attachment descriptions preference not working
This commit is contained in:
parent
c5d2e9af68
commit
18e91feb00
|
@ -82,8 +82,8 @@ class ComposeAttachmentTableViewCell: UITableViewCell {
|
||||||
|
|
||||||
extension ComposeAttachmentTableViewCell: UITextViewDelegate {
|
extension ComposeAttachmentTableViewCell: UITextViewDelegate {
|
||||||
func textViewDidChange(_ textView: UITextView) {
|
func textViewDidChange(_ textView: UITextView) {
|
||||||
delegate?.attachmentDescriptionChanged(self)
|
|
||||||
attachment.attachmentDescription = textView.text
|
attachment.attachmentDescription = textView.text
|
||||||
updateDescriptionPlaceholderLabel()
|
updateDescriptionPlaceholderLabel()
|
||||||
|
delegate?.attachmentDescriptionChanged(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,13 +25,14 @@ class ComposeAttachmentsViewController: UITableViewController {
|
||||||
var attachments: [CompositionAttachment] = [] {
|
var attachments: [CompositionAttachment] = [] {
|
||||||
didSet {
|
didSet {
|
||||||
delegate?.composeSelectedAttachmentsDidChange()
|
delegate?.composeSelectedAttachmentsDidChange()
|
||||||
|
delegate?.composeRequiresAttachmentDescriptionsDidChange()
|
||||||
updateAddAttachmentsButtonEnabled()
|
updateAddAttachmentsButtonEnabled()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var requiresAttachmentDescriptions: Bool {
|
var requiresAttachmentDescriptions: Bool {
|
||||||
if Preferences.shared.requireAttachmentDescriptions {
|
if Preferences.shared.requireAttachmentDescriptions {
|
||||||
return !attachments.allSatisfy { $0.description.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty }
|
return attachments.contains { $0.attachmentDescription.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty }
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue