feat: fulfill the content warning when compose reply post
This commit is contained in:
parent
81a1028f20
commit
4041929b3e
|
@ -77,6 +77,7 @@ extension ComposeStatusSection {
|
||||||
return cell
|
return cell
|
||||||
case .input(let replyToStatusObjectID, let attribute):
|
case .input(let replyToStatusObjectID, let attribute):
|
||||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: ComposeStatusContentCollectionViewCell.self), for: indexPath) as! ComposeStatusContentCollectionViewCell
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: ComposeStatusContentCollectionViewCell.self), for: indexPath) as! ComposeStatusContentCollectionViewCell
|
||||||
|
cell.statusContentWarningEditorView.textView.text = attribute.contentWarningContent.value
|
||||||
cell.textEditorView.text = attribute.composeContent.value ?? ""
|
cell.textEditorView.text = attribute.composeContent.value ?? ""
|
||||||
managedObjectContext.perform {
|
managedObjectContext.perform {
|
||||||
guard let replyToStatusObjectID = replyToStatusObjectID,
|
guard let replyToStatusObjectID = replyToStatusObjectID,
|
||||||
|
|
|
@ -112,6 +112,10 @@ final class ComposeViewModel {
|
||||||
for acct in mentionAccts {
|
for acct in mentionAccts {
|
||||||
UITextChecker.learnWord(acct)
|
UITextChecker.learnWord(acct)
|
||||||
}
|
}
|
||||||
|
if let spoilerText = status.spoilerText, !spoilerText.isEmpty {
|
||||||
|
self.isContentWarningComposing.value = true
|
||||||
|
self.composeStatusAttribute.contentWarningContent.value = spoilerText
|
||||||
|
}
|
||||||
|
|
||||||
let initialComposeContent = mentionAccts.joined(separator: " ")
|
let initialComposeContent = mentionAccts.joined(separator: " ")
|
||||||
let preInsertedContent: String? = initialComposeContent.isEmpty ? nil : initialComposeContent + " "
|
let preInsertedContent: String? = initialComposeContent.isEmpty ? nil : initialComposeContent + " "
|
||||||
|
|
Loading…
Reference in New Issue