fix: bad rendering canCert if identity is created

This commit is contained in:
poka 2022-08-20 22:46:21 +02:00
parent 92992c2f69
commit 3100dc5126
4 changed files with 9 additions and 9 deletions

View File

@ -231,6 +231,8 @@ class SubstrateSdk with ChangeNotifier {
Future<Map<String, int>> certState(String from, String to) async { Future<Map<String, int>> certState(String from, String to) async {
Map<String, int> result = {}; Map<String, int> result = {};
final toStatus = await idtyStatus(to);
if (from != to && await isMemberGet(from)) { if (from != to && await isMemberGet(from)) {
final removableOn = await getCertValidityPeriod(from, to); final removableOn = await getCertValidityPeriod(from, to);
final certMeta = await getCertMeta(from); final certMeta = await getCertMeta(from);
@ -244,15 +246,14 @@ class SubstrateSdk with ChangeNotifier {
} else if (nextIssuableOn > blocNumber) { } else if (nextIssuableOn > blocNumber) {
final certDelayDuration = (nextIssuableOn - blocNumber) * 6; final certDelayDuration = (nextIssuableOn - blocNumber) * 6;
result.putIfAbsent('certDelay', () => certDelayDuration); result.putIfAbsent('certDelay', () => certDelayDuration);
} else if (toStatus == 'Created') {
result.putIfAbsent('toStatus', () => 1);
} else { } else {
result.putIfAbsent('canCert', () => 0); result.putIfAbsent('canCert', () => 0);
} }
} }
final toStatus = await idtyStatus(to); // if (toStatus == 'Created') result.putIfAbsent('toStatus', () => 1);
// log.d('certMeta: $toStatus');
if (toStatus == 'Created') result.putIfAbsent('toStatus', () => 1);
return result; return result;
} }

View File

@ -138,10 +138,9 @@ class WalletsProfilesProvider with ChangeNotifier {
Provider.of<CesiumPlusProvider>(context, listen: false); Provider.of<CesiumPlusProvider>(context, listen: false);
// SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false); // SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
bool isAccountExist = balanceCache[address] != 0;
return Stack(children: <Widget>[ return Stack(children: <Widget>[
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
bool isAccountExist = balanceCache[address] != 0;
return Container( return Container(
height: 180, height: 180,
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@ -270,8 +270,8 @@ class WalletViewScreen extends StatelessWidget {
fontSize: buttonFontSize, fontSize: buttonFontSize,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
]), ])
if (toStatus == 1) else if (toStatus == 1)
waitToCert('mustConfirmHisIdentity', duration) waitToCert('mustConfirmHisIdentity', duration)
else if (snapshot.data!['certRenewable'] != null && else if (snapshot.data!['certRenewable'] != null &&
duration != 'seconds'.tr(args: ['0'])) duration != 'seconds'.tr(args: ['0']))

View File

@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages. # 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 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: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'