mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +01:00
Add exception handling for Reddit app when sharing since it doesn't pass the URL correctly to the share sheet.
This commit is contained in:
parent
97a762a450
commit
6cdb2cbfd0
@ -88,9 +88,12 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
self?.url = url
|
self?.url = url
|
||||||
|
return
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reddit in particular doesn't pass the URL correctly and instead puts it in the contentText
|
||||||
|
url = URL(string: contentText)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func isContentValid() -> Bool {
|
override func isContentValid() -> Bool {
|
||||||
@ -103,7 +106,11 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = contentText.isEmpty ? nil : contentText
|
var name: String? = nil
|
||||||
|
if !contentText.mayBeURL {
|
||||||
|
name = contentText.isEmpty ? nil : contentText
|
||||||
|
}
|
||||||
|
|
||||||
let request = ExtensionFeedAddRequest(name: name, feedURL: url, destinationContainerID: containerID)
|
let request = ExtensionFeedAddRequest(name: name, feedURL: url, destinationContainerID: containerID)
|
||||||
ExtensionFeedAddRequestFile.save(request)
|
ExtensionFeedAddRequestFile.save(request)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user