Fix drafts not being saved
This commit is contained in:
parent
fb39a93569
commit
25e4e35b1f
@ -70,7 +70,15 @@ public class Draft: NSManagedObject, Identifiable {
|
||||
}
|
||||
|
||||
extension Draft {
|
||||
public var hasContent: Bool {
|
||||
var hasText: Bool {
|
||||
!text.isEmpty && text != initialText
|
||||
}
|
||||
|
||||
var hasContentWarning: Bool {
|
||||
contentWarningEnabled && contentWarning != initialContentWarning
|
||||
}
|
||||
|
||||
public var hasContent: Bool {
|
||||
hasText || hasContentWarning || attachments.count > 0 || (pollEnabled && poll!.hasContent)
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ private struct PostButton: View {
|
||||
|
||||
private var draftValid: Bool {
|
||||
draft.editedStatusID != nil ||
|
||||
((draft.hasContent || draft.attachments.count > 0)
|
||||
((draft.hasText || draft.attachments.count > 0)
|
||||
&& hasCharactersRemaining
|
||||
&& attachmentsValid
|
||||
&& pollValid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user