diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index 377dc2116556a65727c9598a266c2e03e8b337f5..13a85cf3be255b7158bdc6b599dffe66d6feed0b 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -231,6 +231,8 @@ class SubstrateSdk with ChangeNotifier { Future<Map<String, int>> certState(String from, String to) async { Map<String, int> result = {}; + final toStatus = await idtyStatus(to); + if (from != to && await isMemberGet(from)) { final removableOn = await getCertValidityPeriod(from, to); final certMeta = await getCertMeta(from); @@ -244,15 +246,14 @@ class SubstrateSdk with ChangeNotifier { } else if (nextIssuableOn > blocNumber) { final certDelayDuration = (nextIssuableOn - blocNumber) * 6; result.putIfAbsent('certDelay', () => certDelayDuration); + } else if (toStatus == 'Created') { + result.putIfAbsent('toStatus', () => 1); } else { result.putIfAbsent('canCert', () => 0); } } - final toStatus = await idtyStatus(to); - // log.d('certMeta: $toStatus'); - - if (toStatus == 'Created') result.putIfAbsent('toStatus', () => 1); + // if (toStatus == 'Created') result.putIfAbsent('toStatus', () => 1); return result; } diff --git a/lib/providers/wallets_profiles.dart b/lib/providers/wallets_profiles.dart index f1fcc50e886083914c70f4ddc3ae99a3aece570d..ce181c5a8e8e9c0dc6ea7a129666f196547d9ceb 100644 --- a/lib/providers/wallets_profiles.dart +++ b/lib/providers/wallets_profiles.dart @@ -138,10 +138,9 @@ class WalletsProfilesProvider with ChangeNotifier { Provider.of<CesiumPlusProvider>(context, listen: false); // SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false); - bool isAccountExist = balanceCache[address] != 0; - return Stack(children: <Widget>[ Consumer<SubstrateSdk>(builder: (context, sub, _) { + bool isAccountExist = balanceCache[address] != 0; return Container( height: 180, decoration: BoxDecoration( diff --git a/lib/screens/wallet_view.dart b/lib/screens/wallet_view.dart index 994cdec0e906007da77cade110b57a446e47fd77..bbe47d702c0f04093755a3ec969045957d956ac2 100644 --- a/lib/screens/wallet_view.dart +++ b/lib/screens/wallet_view.dart @@ -270,8 +270,8 @@ class WalletViewScreen extends StatelessWidget { fontSize: buttonFontSize, fontWeight: FontWeight.w500), ), - ]), - if (toStatus == 1) + ]) + else if (toStatus == 1) waitToCert('mustConfirmHisIdentity', duration) else if (snapshot.data!['certRenewable'] != null && duration != 'seconds'.tr(args: ['0'])) diff --git a/pubspec.yaml b/pubspec.yaml index 0be35480124cd9bd3187074d04bfa670debd9571..2becac750c65bd1376944d7c3ae3e51c4a721ed6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: Pay with G1. # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.0.9+24 +version: 0.0.10+26 environment: sdk: '>=2.12.0 <3.0.0'