fix: validate activeUnit after refreshing mint units

This commit is contained in:
Forte11Cuba
2026-04-03 15:48:02 -06:00
parent ab13e8f6c2
commit 4f91a2be1c
+6
View File
@@ -435,6 +435,12 @@ class WalletProvider extends ChangeNotifier {
_mintUnits[mintUrl] = unitList;
changed = true;
debugPrint('Unidades actualizadas para $mintUrl: $unitList');
// Validar _activeUnit si este es el mint activo
if (mintUrl == _activeMintUrl && !unitList.contains(_activeUnit)) {
_activeUnit = unitList.first;
debugPrint('Active unit reset to ${unitList.first} for $mintUrl');
}
}
} catch (e) {
debugPrint('Error refrescando unidades de $mintUrl: $e');