diff --git a/Packages/ComposeUI/Sources/ComposeUI/CoreData/Draft.swift b/Packages/ComposeUI/Sources/ComposeUI/CoreData/Draft.swift index 62195679..6c35b9cf 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/CoreData/Draft.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/CoreData/Draft.swift @@ -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) + } } diff --git a/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeNavigationBarActions.swift b/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeNavigationBarActions.swift index 2544da3a..49036f17 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeNavigationBarActions.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Views/ComposeNavigationBarActions.swift @@ -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)