TF-3767 Clean up recent searches whenever re-login and exceeds limit
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/datasource/cleanup_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/datasource_impl/cleanup_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/local/recent_login_url_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/local/recent_login_username_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/local/recent_search_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/data/repository/cleanup_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/domain/repository/cleanup_repository.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/domain/usecases/cleanup_email_cache_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/domain/usecases/cleanup_recent_login_url_cache_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/domain/usecases/cleanup_recent_login_username_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/domain/usecases/cleanup_recent_search_cache_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/cleanup/presentation/cleanup_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/home/presentation/home_controller.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/authentication_oidc_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/check_oidc_is_available_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/cache_exception_thrower.dart';
|
||||
import 'package:tmail_ui_user/main/utils/email_receive_manager.dart';
|
||||
|
||||
class HomeBindings extends BaseBindings {
|
||||
@@ -25,44 +16,26 @@ class HomeBindings extends BaseBindings {
|
||||
Get.lazyPut(() => HomeController(
|
||||
Get.find<CleanupEmailCacheInteractor>(),
|
||||
Get.find<EmailReceiveManager>(),
|
||||
Get.find<CleanupRecentSearchCacheInteractor>(),
|
||||
Get.find<CleanupRecentLoginUrlCacheInteractor>(),
|
||||
Get.find<CleanupRecentLoginUsernameCacheInteractor>(),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsDataSource() {
|
||||
Get.lazyPut<CleanupDataSource>(() => Get.find<CleanupDataSourceImpl>());
|
||||
}
|
||||
void bindingsDataSource() {}
|
||||
|
||||
@override
|
||||
void bindingsDataSourceImpl() {
|
||||
Get.lazyPut(() => CleanupDataSourceImpl(
|
||||
Get.find<EmailCacheManager>(),
|
||||
Get.find<RecentSearchCacheManager>(),
|
||||
Get.find<RecentLoginUrlCacheManager>(),
|
||||
Get.find<RecentLoginUsernameCacheManager>(),
|
||||
Get.find<CacheExceptionThrower>(),
|
||||
));
|
||||
}
|
||||
void bindingsDataSourceImpl() {}
|
||||
|
||||
@override
|
||||
void bindingsInteractor() {
|
||||
Get.lazyPut(() => CleanupEmailCacheInteractor(Get.find<CleanupRepository>()));
|
||||
Get.lazyPut(() => CleanupRecentSearchCacheInteractor(Get.find<CleanupRepository>()));
|
||||
Get.lazyPut(() => CleanupRecentLoginUrlCacheInteractor(Get.find<CleanupRepository>()));
|
||||
Get.lazyPut(() => CleanupRecentLoginUsernameCacheInteractor(Get.find<CleanupRepository>()));
|
||||
CleanupBindings().dependencies();
|
||||
Get.lazyPut(() => CheckOIDCIsAvailableInteractor(Get.find<AuthenticationOIDCRepository>()));
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsRepository() {
|
||||
Get.lazyPut<CleanupRepository>(() => Get.find<CleanupRepositoryImpl>());
|
||||
}
|
||||
void bindingsRepository() {}
|
||||
|
||||
@override
|
||||
void bindingsRepositoryImpl() {
|
||||
Get.lazyPut(() => CleanupRepositoryImpl(Get.find<CleanupDataSource>()));
|
||||
}
|
||||
void bindingsRepositoryImpl() {}
|
||||
}
|
||||
Reference in New Issue
Block a user