From 87700325cfb0f0961682e07a32f6c359a91190b1 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 12 Sep 2021 21:34:47 -0500 Subject: [PATCH] Changed to use preferredURL incase we run into any malformed links --- Mac/MainWindow/MainWindowController.swift | 2 +- iOS/MasterTimeline/MasterTimelineViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index ba4189921..aec3369c7 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -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) } } diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 046d3e6cc..4d820d205 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -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