Fix URLs getting pasted as broken attachments

Closes #309
This commit is contained in:
Shadowfacts 2022-12-14 09:47:17 -05:00
parent f55a870964
commit 360db07ef2
1 changed files with 3 additions and 1 deletions

View File

@ -165,7 +165,9 @@ struct MainComposeWrappedTextView: UIViewRepresentable {
}
override func paste(_ sender: Any?) {
if UIPasteboard.general.contains(pasteboardTypes: CompositionAttachment.readableTypeIdentifiersForItemProvider) {
// we deliberately exclude the other CompositionAttachment readable type identifiers, because that's too overzealous with the conversion
// and things like URLs end up pasting as attachments
if UIPasteboard.general.contains(pasteboardTypes: UIImage.readableTypeIdentifiersForItemProvider) {
uiState.delegate?.paste(itemProviders: UIPasteboard.general.itemProviders)
} else {
super.paste(sender)