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!
.evalJavascript('api.query.identity.identityIndexOf("$to")');
if (idtyIndexFrom == null || idtyIndexTo == null) return {};
final certData = await sdk.webView!.evalJavascript(
'api.query.cert.storageCertsByIssuer($idtyIndexFrom, $idtyIndexTo)') ??
'';

View File

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

View File

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

View File

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