mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Wait until statuses have finished syncing before allowing the application to quit. Fixes #2718
This commit is contained in:
@@ -61,6 +61,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||
}
|
||||
}
|
||||
|
||||
var isShutDownSyncDone = false
|
||||
|
||||
@IBOutlet var debugMenuItem: NSMenuItem!
|
||||
@IBOutlet var sortByOldestArticleOnTopMenuItem: NSMenuItem!
|
||||
@IBOutlet var sortByNewestArticleOnTopMenuItem: NSMenuItem!
|
||||
@@ -310,6 +312,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||
func applicationWillTerminate(_ notification: Notification) {
|
||||
shuttingDown = true
|
||||
saveState()
|
||||
|
||||
AccountManager.shared.syncArticleStatusAll() {
|
||||
self.isShutDownSyncDone = true
|
||||
}
|
||||
|
||||
while !isShutDownSyncDone && RunLoop.current.run(mode: .default, before: .distantFuture) { }
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
Reference in New Issue
Block a user