diff --git a/Tusker/Screens/Compose/ComposeAttachmentsList.swift b/Tusker/Screens/Compose/ComposeAttachmentsList.swift index 7c79f2fc66..584fc39725 100644 --- a/Tusker/Screens/Compose/ComposeAttachmentsList.swift +++ b/Tusker/Screens/Compose/ComposeAttachmentsList.swift @@ -95,8 +95,7 @@ struct ComposeAttachmentsList: View { case .pleroma: return true case .mastodon: - // todo: this technically allows invalid image/video combinations - return draft.attachments.count < 4 + return draft.attachments.count < 4 && draft.attachments.allSatisfy { $0.data.type == .image } } } diff --git a/Tusker/Screens/Compose/ComposeHostingController.swift b/Tusker/Screens/Compose/ComposeHostingController.swift index 2fca4e6174..d8fe99c5ea 100644 --- a/Tusker/Screens/Compose/ComposeHostingController.swift +++ b/Tusker/Screens/Compose/ComposeHostingController.swift @@ -199,7 +199,8 @@ class ComposeHostingController: UIHostingController { case .pleroma: return true case .mastodon: - // todo: this technically allows invalid video/image combinations + guard draft.attachments.allSatisfy({ $0.data.type == .image }) else { return false } + // todo: if providers are videos, this technically allows invalid video/image combinations return itemProviders.count + draft.attachments.count <= 4 } }