TF-1897 Clear session data when logout
(cherry picked from commit b48013039222ea232a6fb80e08002b526e40204c)
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:core/utils/platform_info.dart';
|
|||||||
import 'package:tmail_ui_user/features/caching/clients/account_cache_client.dart';
|
import 'package:tmail_ui_user/features/caching/clients/account_cache_client.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/clients/detailed_email_hive_cache_client.dart';
|
import 'package:tmail_ui_user/features/caching/clients/detailed_email_hive_cache_client.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/clients/opened_email_hive_cache_client.dart';
|
import 'package:tmail_ui_user/features/caching/clients/opened_email_hive_cache_client.dart';
|
||||||
|
import 'package:tmail_ui_user/features/caching/clients/session_hive_cache_client.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/config/hive_cache_config.dart';
|
import 'package:tmail_ui_user/features/caching/config/hive_cache_config.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/clients/email_cache_client.dart';
|
import 'package:tmail_ui_user/features/caching/clients/email_cache_client.dart';
|
||||||
import 'package:tmail_ui_user/features/caching/clients/fcm_cache_client.dart';
|
import 'package:tmail_ui_user/features/caching/clients/fcm_cache_client.dart';
|
||||||
@@ -30,6 +31,7 @@ class CachingManager {
|
|||||||
final OpenedEmailHiveCacheClient _openedEmailHiveCacheClient;
|
final OpenedEmailHiveCacheClient _openedEmailHiveCacheClient;
|
||||||
final FileUtils _fileUtils;
|
final FileUtils _fileUtils;
|
||||||
final SendingEmailCacheManager _sendingEmailCacheManager;
|
final SendingEmailCacheManager _sendingEmailCacheManager;
|
||||||
|
final SessionHiveCacheClient _sessionHiveCacheClient;
|
||||||
|
|
||||||
CachingManager(
|
CachingManager(
|
||||||
this._mailboxCacheClient,
|
this._mailboxCacheClient,
|
||||||
@@ -44,6 +46,7 @@ class CachingManager {
|
|||||||
this._openedEmailHiveCacheClient,
|
this._openedEmailHiveCacheClient,
|
||||||
this._fileUtils,
|
this._fileUtils,
|
||||||
this._sendingEmailCacheManager,
|
this._sendingEmailCacheManager,
|
||||||
|
this._sessionHiveCacheClient,
|
||||||
);
|
);
|
||||||
|
|
||||||
Future<void> clearAll() async {
|
Future<void> clearAll() async {
|
||||||
@@ -57,6 +60,7 @@ class CachingManager {
|
|||||||
_accountCacheClient.clearAllData(),
|
_accountCacheClient.clearAllData(),
|
||||||
if (PlatformInfo.isMobile)
|
if (PlatformInfo.isMobile)
|
||||||
...[
|
...[
|
||||||
|
_sessionHiveCacheClient.clearAllData(),
|
||||||
_detailedEmailHiveCacheClient.clearAllData(),
|
_detailedEmailHiveCacheClient.clearAllData(),
|
||||||
_openedEmailHiveCacheClient.clearAllData(),
|
_openedEmailHiveCacheClient.clearAllData(),
|
||||||
_clearSendingEmailCache(),
|
_clearSendingEmailCache(),
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ class LocalBindings extends Bindings {
|
|||||||
Get.find<OpenedEmailHiveCacheClient>(),
|
Get.find<OpenedEmailHiveCacheClient>(),
|
||||||
Get.find<FileUtils>(),
|
Get.find<FileUtils>(),
|
||||||
Get.find<SendingEmailCacheManager>(),
|
Get.find<SendingEmailCacheManager>(),
|
||||||
|
Get.find<SessionHiveCacheClient>(),
|
||||||
));
|
));
|
||||||
Get.put(SharePreferenceSpamReportDataSource(Get.find<SharedPreferences>()));
|
Get.put(SharePreferenceSpamReportDataSource(Get.find<SharedPreferences>()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user