diff --git a/lib/shared/services/localization/localization_service.dart b/lib/shared/services/localization/localization_service.dart index 7fc17118..3784de0a 100644 --- a/lib/shared/services/localization/localization_service.dart +++ b/lib/shared/services/localization/localization_service.dart @@ -59,7 +59,7 @@ class LocalizationService { final bool isInactived = _isInactived(locals); final bool isPending = _isPending(locals); final bool isUnique = locals.length == 1; - final bool isBlocked = locals[0]['CLU_STATUS'] == 'B'; + final bool isBlocked = locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty; final bool isEnabled = isUnique && isActive; final bool isDisabled = isUnique && isBlocked; final bool isUnselected = _isUnselected(); @@ -80,21 +80,23 @@ class LocalizationService { return await processData(context); } else if (isAvailable) { return await processData(context); - } else if (!isUnique && !isActive) { - log('() => not unique and not active'); + } else { + if (!isUnique && !isActive) { + log('() => not unique and not active'); + return false; + } else if (!isUnique && isInactived) { + log('() => not unique and inactived'); + return false; + } else if (!isUnique && isPending) { + log('() => not unique and pending'); + return false; + } else if (!isUnique && isBlocked) { + log('() => not unique and blocked'); return false; - } else if (!isUnique && isBlocked) { - log('() => not unique and blocked'); - return false; - } else if (!isUnique && isPending) { - log('() => not unique and pending'); - return false; - } else if (!isUnique && isInactived) { - log('() => not unique and inactived'); - return false; - } else { - await StorageUtil().ensureInitialization(); - return await selectLocal(context); + } else { + await StorageUtil().ensureInitialization(); + return await selectLocal(context); + } } } catch (e, s) { log('() => stack: $s');