fix: ignore certs state if dest identity is null

This commit is contained in:
poka 2022-08-08 15:03:22 +02:00
parent ef3ae9db4a
commit d8f3936e20
4 changed files with 5 additions and 4 deletions

View File

@ -259,6 +259,8 @@ class SubstrateSdk with ChangeNotifier {
final idtyIndexTo = await sdk.webView! final idtyIndexTo = await sdk.webView!
.evalJavascript('api.query.identity.identityIndexOf("$to")'); .evalJavascript('api.query.identity.identityIndexOf("$to")');
if (idtyIndexFrom == null || idtyIndexTo == null) return {};
final certData = await sdk.webView!.evalJavascript( final certData = await sdk.webView!.evalJavascript(
'api.query.cert.storageCertsByIssuer($idtyIndexFrom, $idtyIndexTo)') ?? 'api.query.cert.storageCertsByIssuer($idtyIndexFrom, $idtyIndexTo)') ??
''; '';

View File

@ -137,7 +137,7 @@ class WalletOptionsProvider with ChangeNotifier {
_showText(String text, _showText(String text,
[double size = 18, bool bold = false, bool smooth = true]) { [double size = 18, bool bold = false, bool smooth = true]) {
log.d(text); log.d('$address $text');
return AnimatedFadeOutIn<String>( return AnimatedFadeOutIn<String>(
data: text, data: text,
duration: Duration(milliseconds: smooth ? 200 : 0), duration: Duration(milliseconds: smooth ? 200 : 0),

View File

@ -80,7 +80,6 @@ class SearchResultScreen extends StatelessWidget {
future: searchProvider.searchAddress(), future: searchProvider.searchAddress(),
builder: (context, AsyncSnapshot<List?> snapshot) { builder: (context, AsyncSnapshot<List?> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
log.d(snapshot.data);
if (snapshot.data?.isEmpty ?? true) { if (snapshot.data?.isEmpty ?? true) {
return duniterIndexer.searchIdentity( return duniterIndexer.searchIdentity(
context, searchProvider.searchController.text); context, searchProvider.searchController.text);

View File

@ -127,7 +127,6 @@ class WalletViewScreen extends StatelessWidget {
future: sub.certState(defaultWallet.address!, future: sub.certState(defaultWallet.address!,
pubkey!), // .canCertify(_defaultWallet.address!, pubkey!), pubkey!), // .canCertify(_defaultWallet.address!, pubkey!),
builder: (context, AsyncSnapshot<Map<String, int>> snapshot) { builder: (context, AsyncSnapshot<Map<String, int>> snapshot) {
// log.d(snapshot.data);
if (snapshot.data == null) return const SizedBox(); if (snapshot.data == null) return const SizedBox();
String duration = ''; String duration = '';
if (snapshot.data!['certDelay'] != null || if (snapshot.data!['certDelay'] != null ||
@ -162,6 +161,7 @@ class WalletViewScreen extends StatelessWidget {
duration = 'months'.tr(args: [months.toString()]); duration = 'months'.tr(args: [months.toString()]);
} }
} }
return Visibility( return Visibility(
visible: (snapshot.data != {}), visible: (snapshot.data != {}),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
@ -175,7 +175,7 @@ class WalletViewScreen extends StatelessWidget {
color: color:
const Color(0xffFFD58D), // button color const Color(0xffFFD58D), // button color
child: InkWell( child: InkWell(
key: const Key('copyKey'), key: const Key('certify'),
splashColor: orangeC, // inkwell color splashColor: orangeC, // inkwell color
child: const Padding( child: const Padding(
padding: EdgeInsets.only(bottom: 0), padding: EdgeInsets.only(bottom: 0),