fix(cnb): delete all cache before execute logout

(cherry picked from commit 7aa346984f9f1a65005a8cc8c0670fdade6502e3)
This commit is contained in:
dab246
2025-11-27 02:43:13 +07:00
committed by Dat H. Pham
parent 5cbf189ffe
commit 363fe0aa58
2 changed files with 23 additions and 4 deletions
+13
View File
@@ -448,6 +448,8 @@ abstract class BaseController extends GetxController
return;
}
await clearAllMailDataCached();
_isFcmEnabled = _isFcmActivated(session, accountId);
if (isAuthenticatedWithOidc) {
consumeState(logoutOidcInteractor.execute());
@@ -558,6 +560,17 @@ abstract class BaseController extends GetxController
removeAllPageAndGoToLogin();
}
Future<void> clearAllMailDataCached() async {
try {
await cachingManager.clearMailDataCached();
if (PlatformInfo.isMobile) {
await cachingManager.clearAllFileInStorage();
}
} catch (e) {
logError('BaseController::clearAllMailDataCached:Exception = $e');
}
}
Future<void> clearAllData() async {
try {
if (isAuthenticatedWithOidc) {