mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Empty Article caches on app-background and low-memory notifications.
This commit is contained in:
1 parent
a18980f65a
commit
eb099f539b
1 file changed
+8
@@ -135,6 +135,8 @@ import ErrorLog
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidInitialize(_:)), name: .UnreadCountDidInitialize, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(accountStateDidChange(_:)), name: .AccountStateDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleAppDidGoToBackground(_:)), name: .appDidGoToBackground, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleLowMemory(_:)), name: .lowMemory, object: nil)
|
||||
DispatchQueue.main.async {
|
||||
self.updateUnreadCount()
|
||||
}
|
||||
@@ -457,7 +459,13 @@ import ErrorLog
|
||||
updateUnreadCount()
|
||||
}
|
||||
|
||||
@objc func handleLowMemory(_ notification: Notification) {
|
||||
emptyCaches()
|
||||
}
|
||||
|
||||
@objc func handleAppDidGoToBackground(_ notification: Notification) {
|
||||
emptyCaches()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
Reference in new issue
Block a user