From be81fdae0a7f84ebf648f22df2de129b2bf41b47 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 21 May 2019 17:20:49 -0500 Subject: [PATCH] Send article statuses to Feedbin on app terminate --- Mac/AppDelegate.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) 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