diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 2e593ac20..7f3658389 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -212,6 +212,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, func applicationWillTerminate(_ notification: Notification) { shuttingDown = true saveState() + + let group = DispatchGroup() + + group.enter() + AccountManager.shared.syncArticleStatusAll() { + group.leave() + } + + let timeout = DispatchTime.now() + .seconds(1) + _ = group.wait(timeout: timeout) } // MARK: Notifications