TF-1915 Remove the needToOpen parameter in cases where it is not needed

(cherry picked from commit 1bd53ab9962494bbf48c86f4e61487f3316cbb62)
This commit is contained in:
dab246
2023-06-09 10:15:09 +07:00
committed by Dat Vu
parent 50635049ab
commit 20168f5e8d
5 changed files with 9 additions and 9 deletions
@@ -12,8 +12,8 @@ class AuthenticationInfoCacheManager {
authenticationInfoCache);
}
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false}) {
return _authenticationInfoCacheClient.getItem(AuthenticationInfoCache.keyCacheValue, needToReopen: needToReopen);
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
return _authenticationInfoCacheClient.getItem(AuthenticationInfoCache.keyCacheValue);
}
Future<void> removeAuthenticationInfo() {
@@ -36,8 +36,8 @@ class CredentialRepositoryImpl extends CredentialRepository {
}
@override
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false}) {
return _authenticationInfoCacheManager.getAuthenticationInfoStored(needToReopen: needToReopen);
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
return _authenticationInfoCacheManager.getAuthenticationInfoStored();
}
@override
@@ -9,7 +9,7 @@ abstract class CredentialRepository {
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache);
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false});
Future<AuthenticationInfoCache?> getAuthenticationInfoStored();
Future<void> removeAuthenticationInfo();
}
@@ -20,7 +20,7 @@ class GetAuthenticatedAccountInteractor {
this._getStoredTokenOidcInteractor
);
Stream<Either<Failure, Success>> execute({bool needToReopen = false}) async* {
Stream<Either<Failure, Success>> execute() async* {
try {
yield Right<Failure, Success>(LoadingState());
final account = await _accountRepository.getCurrentAccount();
@@ -29,7 +29,7 @@ class GetAuthenticatedAccountInteractor {
if (account.authenticationType == AuthenticationType.oidc) {
yield* _getStoredTokenOidcInteractor.execute(account.id);
} else {
yield await _getCredentialInteractor.execute(needToReopen: needToReopen);
yield await _getCredentialInteractor.execute();
}
} catch (e) {
logError('GetAuthenticatedAccountInteractor::execute(): $e');
@@ -15,10 +15,10 @@ class GetCredentialInteractor {
GetCredentialInteractor(this.credentialRepository);
Future<Either<Failure, Success>> execute({bool needToReopen = false}) async {
Future<Either<Failure, Success>> execute() async {
try {
final baseUrl = await credentialRepository.getBaseUrl();
final authenticationInfo = await credentialRepository.getAuthenticationInfoStored(needToReopen: needToReopen);
final authenticationInfo = await credentialRepository.getAuthenticationInfoStored();
if (isCredentialValid(baseUrl) && authenticationInfo != null) {
return Right(GetCredentialViewState(
baseUrl,