mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-03 18:56:14 +00:00
Fix various concurrency issues.
This commit is contained in:
1 parent
563d1febbc
commit
b7c7c09ea6
4 files changed
+10
-9
No files matched your search
@@ -34,7 +34,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
|
||||
}
|
||||
}
|
||||
|
||||
private static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
nonisolated private static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
||||
|
||||
var unreadCount = 0 {
|
||||
didSet {
|
||||
@@ -343,13 +343,12 @@ private extension AppDelegate {
|
||||
|
||||
/// Schedules a background app refresh based on `AppDefaults.refreshInterval`.
|
||||
func scheduleBackgroundFeedRefresh() {
|
||||
let request = BGAppRefreshTaskRequest(identifier: "com.ranchero.NetNewsWire.FeedRefresh")
|
||||
request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60)
|
||||
|
||||
// We send this to a dedicated serial queue because as of 11/05/19 on iOS 13.2 the call to the
|
||||
// task scheduler can hang indefinitely.
|
||||
backgroundTaskDispatchQueue.async {
|
||||
do {
|
||||
let request = BGAppRefreshTaskRequest(identifier: "com.ranchero.NetNewsWire.FeedRefresh")
|
||||
request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60)
|
||||
try BGTaskScheduler.shared.submit(request)
|
||||
} catch {
|
||||
Self.logger.error("Could not schedule app refresh: \(error.localizedDescription)")
|
||||
|
||||
@@ -42,7 +42,10 @@ final class OpenInBrowserActivity: UIActivity {
|
||||
return
|
||||
}
|
||||
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
Task { @MainActor in
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
|
||||
activityDidFinish(true)
|
||||
}
|
||||
}
|
||||
@@ -361,7 +361,7 @@ extension WebViewController: WKNavigationDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
||||
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping @MainActor @Sendable (WKNavigationActionPolicy) -> Void) {
|
||||
|
||||
if navigationAction.navigationType == .linkActivated {
|
||||
guard let url = navigationAction.request.url else {
|
||||
@@ -613,8 +613,7 @@ private extension WebViewController {
|
||||
|
||||
func startArticleExtractor() {
|
||||
guard articleExtractor == nil else { return }
|
||||
if let link = article?.preferredLink, let extractor = ArticleExtractor(link) {
|
||||
extractor.delegate = self
|
||||
if let link = article?.preferredLink, let extractor = ArticleExtractor(link, delegate: self) {
|
||||
extractor.process()
|
||||
articleExtractor = extractor
|
||||
articleExtractorButtonState = .animated
|
||||
|
||||
@@ -22,7 +22,7 @@ private let reuseIdentifier = "FeedCell"
|
||||
private let folderIdentifier = "Folder"
|
||||
private let containerReuseIdentifier = "Container"
|
||||
|
||||
class MainFeedCollectionViewController: UICollectionViewController, UndoableCommandRunner {
|
||||
final class MainFeedCollectionViewController: UICollectionViewController, UndoableCommandRunner {
|
||||
|
||||
@IBOutlet weak var filterButton: UIBarButtonItem!
|
||||
@IBOutlet weak var addNewItemButton: UIBarButtonItem! {
|
||||
|
||||
Reference in new issue
Block a user