mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Fix pasting no longer working for rich text formats.
This commit is contained in:
@@ -125,9 +125,14 @@ extension NSItemProvider {
|
|||||||
let supportedContentTypes = registeredContentTypes
|
let supportedContentTypes = registeredContentTypes
|
||||||
.filter { isMimeTypeSupported($0.preferredMIMEType) || isIdentifierSupported($0.identifier) }
|
.filter { isMimeTypeSupported($0.preferredMIMEType) || isIdentifierSupported($0.identifier) }
|
||||||
|
|
||||||
// If we can't find any supported types try to fallback to the first with
|
// If we can't find any supported types but we do find a fileURL, use
|
||||||
// a valid extension. Return nil otherwise.
|
// the sibling type that provides a correct file extension for it.
|
||||||
|
// Return nil otherwise which will make it be inserted into the composer as text.
|
||||||
guard !supportedContentTypes.isEmpty else {
|
guard !supportedContentTypes.isEmpty else {
|
||||||
|
guard registeredContentTypes.contains(where: { $0.conforms(to: .fileURL) }) else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
for type in registeredContentTypes {
|
for type in registeredContentTypes {
|
||||||
if let fileExtension = type.preferredFilenameExtension {
|
if let fileExtension = type.preferredFilenameExtension {
|
||||||
return .init(type: type, fileExtension: fileExtension)
|
return .init(type: type, fileExtension: fileExtension)
|
||||||
|
|||||||
Reference in New Issue
Block a user