Send article statuses to Feedbin on app terminate

This commit is contained in:
Maurice Parker 2019-05-21 17:20:49 -05:00
parent 98a262e34b
commit be81fdae0a
1 changed files with 10 additions and 0 deletions

View File

@ -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