Hotfix cannot set default identity

This commit is contained in:
DatDang
2024-08-22 14:02:07 +07:00
committed by Dat H. Pham
parent 339eeef1c2
commit 2f669b077c
4 changed files with 33 additions and 57 deletions
@@ -27,9 +27,7 @@ class GetAllIdentitiesInteractor {
_identityUtils.sortListIdentities(identitiesResponse.identities!);
}
yield Right(GetAllIdentitiesSuccess(
identitiesResponse.identities
?.where((identity) => identity.name?.trim().isNotEmpty == true)
.toList(),
identitiesResponse.identities,
identitiesResponse.state));
} catch (exception) {
yield Left(GetAllIdentitiesFailure(exception));
@@ -139,7 +139,7 @@ class IdentitiesController extends BaseController {
void _handleGetAllIdentitiesSuccess(GetAllIdentitiesSuccess success) {
if (success.identities?.isNotEmpty == true) {
final newListIdentities = success.identities!
.where((identity) => identity.mayDelete == true)
.where((identity) => identity.mayDelete == true && identity.name?.trim().isNotEmpty == true)
.toList();
listAllIdentities.addAll(newListIdentities);
}