TF-886 Remove method get/save/remove user profile because not used
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:model/model.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/local/authentication_info_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/model/authentication_info_cache.dart';
|
||||
@@ -32,25 +30,6 @@ class CredentialRepositoryImpl extends CredentialRepository {
|
||||
await sharedPreferences.remove(LoginConstant.keyBaseUrl);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfile> getUserProfile() async {
|
||||
final json = sharedPreferences.getString(LoginConstant.keyUserProfile) ?? '';
|
||||
Map<String, dynamic> mapObject = jsonDecode(json);
|
||||
return UserProfileResponse.fromJson(mapObject).toUserProfile();
|
||||
}
|
||||
|
||||
@override
|
||||
Future removeUserProfile() async {
|
||||
await sharedPreferences.remove(LoginConstant.keyUserProfile);
|
||||
}
|
||||
|
||||
@override
|
||||
Future saveUserProfile(UserProfile userProfile) async {
|
||||
final userProfileResponse = userProfile.toUserProfileResponse();
|
||||
final json = jsonEncode(userProfileResponse.toJson());
|
||||
await sharedPreferences.setString(LoginConstant.keyUserProfile, json);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache) {
|
||||
return _authenticationInfoCacheManager.storeAuthenticationInfo(authenticationInfoCache);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/model/authentication_info_cache.dart';
|
||||
|
||||
abstract class CredentialRepository {
|
||||
@@ -8,12 +7,6 @@ abstract class CredentialRepository {
|
||||
|
||||
Future<Uri> getBaseUrl();
|
||||
|
||||
Future saveUserProfile(UserProfile userProfile);
|
||||
|
||||
Future removeUserProfile();
|
||||
|
||||
Future<UserProfile> getUserProfile();
|
||||
|
||||
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache);
|
||||
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored();
|
||||
|
||||
@@ -22,7 +22,6 @@ class AuthenticationInteractor {
|
||||
credentialRepository.saveBaseUrl(baseUrl),
|
||||
credentialRepository.storeAuthenticationInfo(
|
||||
AuthenticationInfoCache(userName.userName, password.value)),
|
||||
credentialRepository.saveUserProfile(user),
|
||||
_accountRepository.setCurrentAccount(Account(
|
||||
userName.userName,
|
||||
AuthenticationType.basic,
|
||||
|
||||
@@ -15,7 +15,6 @@ class DeleteCredentialInteractor {
|
||||
await Future.wait([
|
||||
credentialRepository.removeBaseUrl(),
|
||||
credentialRepository.removeAuthenticationInfo(),
|
||||
credentialRepository.removeUserProfile(),
|
||||
]);
|
||||
return Right(DeleteCredentialSuccess());
|
||||
} catch (exception) {
|
||||
|
||||
Reference in New Issue
Block a user