From c47c3fc168e27058cd94e57a6f6c1b0561303d67 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Tue, 18 Jul 2023 16:25:00 +0545 Subject: [PATCH] fix: Update polygon card status checking approach #1699 --- lib/app/shared/helper_functions/helper_functions.dart | 4 +--- .../credentials/detail/cubit/credential_details_cubit.dart | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index 094af3a53..5a3464f94 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -106,9 +106,7 @@ bool isEbsiIssuer(CredentialModel credentialModel) { } bool isPolygonssuer(CredentialModel credentialModel) { - return credentialModel.id.startsWith( - 'https://self-hosted-platform.polygonid.me/v1/did:polygonid:polygon:', - ); + return credentialModel.issuer.contains('did:polygonid'); } bool isValidPrivateKey(String value) { diff --git a/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart b/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart index d2dfa75f6..df6a6cb3e 100644 --- a/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart +++ b/lib/dashboard/home/tab_bar/credentials/detail/cubit/credential_details_cubit.dart @@ -95,12 +95,9 @@ class CredentialDetailsCubit extends Cubit { await secureStorageProvider.get(SecureStorageKeys.ssiMnemonic); await polygonIdCubit.initialise(); - final polygonIdNetwork = - await secureStorageProvider.get(SecureStorageKeys.polygonIdNetwork); - String network = Parameters.POLYGON_MAIN_NETWORK; - if (polygonIdNetwork == PolygonIdNetwork.PolygonMainnet.toString()) { + if (item.issuer.contains('polygon:main')) { network = Parameters.POLYGON_MAIN_NETWORK; } else { network = Parameters.POLYGON_TEST_NETWORK;