From eb099f539bb07cdf57e81b13e9dbbc2df4318d9e Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 14 Mar 2026 21:51:27 -0700 Subject: [PATCH] Empty Article caches on app-background and low-memory notifications. --- Modules/Account/Sources/Account/AccountManager.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/Account/Sources/Account/AccountManager.swift b/Modules/Account/Sources/Account/AccountManager.swift index b453ff071..0c226a7d8 100644 --- a/Modules/Account/Sources/Account/AccountManager.swift +++ b/Modules/Account/Sources/Account/AccountManager.swift @@ -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