Changed to use preferredURL incase we run into any malformed links

This commit is contained in:
Maurice Parker 2021-09-12 21:34:47 -05:00
parent fa4b2531f8
commit 87700325cf
2 changed files with 2 additions and 2 deletions

View File

@ -311,7 +311,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
}
@IBAction func copyArticleURL(_ sender: Any?) {
if let link = currentLink {
if let link = oneSelectedArticle?.preferredURL?.absoluteString {
URLPasteboardWriter.write(urlString: link, to: .general)
}
}

View File

@ -915,7 +915,7 @@ private extension MasterTimelineViewController {
}
func copyArticleURLAction(_ article: Article) -> UIAction? {
guard let preferredLink = article.preferredLink, let url = URL(string: preferredLink) else { return nil }
guard let url = article.preferredURL else { return nil }
let title = NSLocalizedString("Copy Article URL", comment: "Copy Article URL")
let action = UIAction(title: title, image: AppAssets.copyImage) { action in
UIPasteboard.general.url = url