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 {
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;
}

View File

@ -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(

View File

@ -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']))

View File

@ -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'