From 59b1cc1741827e598e0016253d9649a0545f2eb1 Mon Sep 17 00:00:00 2001 From: Sai Ranjit Tummalapalli Date: Wed, 28 Aug 2024 20:06:28 +0530 Subject: [PATCH] fix: w3c credential detail navigation Signed-off-by: Sai Ranjit Tummalapalli --- app/components/record/W3CCredentialRecord.tsx | 7 +++++-- app/screens/CredentialDetailsW3C.tsx | 4 ++++ ios/AdeyaWallet.xcodeproj/project.pbxproj | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/components/record/W3CCredentialRecord.tsx b/app/components/record/W3CCredentialRecord.tsx index 8ffc45cb..71e0791e 100644 --- a/app/components/record/W3CCredentialRecord.tsx +++ b/app/components/record/W3CCredentialRecord.tsx @@ -40,6 +40,9 @@ const W3CCredentialRecord: React.FC = ({ const [showAll, setShowAll] = useState(true) const { ListItems, TextTheme, ColorPallet } = useTheme() + const isPrettyVcAvailable = + w3cCredential?.credential?.prettyVc && Object.keys(w3cCredential?.credential?.prettyVc).length > 0 + const styles = StyleSheet.create({ linkContainer: { ...ListItems.recordContainer, @@ -58,7 +61,7 @@ const W3CCredentialRecord: React.FC = ({ }, rowContainer: { flexDirection: 'row', - justifyContent: w3cCredential?.credential?.prettyVc ? 'space-between' : 'flex-end', + justifyContent: isPrettyVcAvailable ? 'space-between' : 'flex-end', backgroundColor: ColorPallet.grayscale.white, }, linkText: { @@ -120,7 +123,7 @@ const W3CCredentialRecord: React.FC = ({ {header()} - {w3cCredential?.credential?.prettyVc && ( + {isPrettyVcAvailable && ( {isCertificateLoading ? ( diff --git a/app/screens/CredentialDetailsW3C.tsx b/app/screens/CredentialDetailsW3C.tsx index 632a79a8..a655c022 100644 --- a/app/screens/CredentialDetailsW3C.tsx +++ b/app/screens/CredentialDetailsW3C.tsx @@ -7,6 +7,7 @@ import { deleteCredentialExchangeRecordById, useCredentialByState, CredentialState, + useConnections, } from '@adeya/ssi' import { BrandingOverlay } from '@hyperledger/aries-oca' import { CredentialOverlay } from '@hyperledger/aries-oca/build/legacy' @@ -61,6 +62,7 @@ const CredentialDetailsW3C: React.FC = ({ navigation, ro const credentialsList = useCredentialByState(CredentialState.Done) const [isDeletingCredential, setIsDeletingCredential] = useState(false) const [isGeneratingPdf, setIsGeneratingPdf] = useState(false) + const { records: connectionRecords } = useConnections() const [overlay, setOverlay] = useState>({ bundle: undefined, @@ -129,6 +131,8 @@ const CredentialDetailsW3C: React.FC = ({ navigation, ro } else if (credential instanceof CredentialExchangeRecord) { const credentialRecordId = credential.credentials[0].credentialRecordId const record = await getW3cCredentialRecordById(agent, credentialRecordId) + const connection = connectionRecords.find(connection => connection.id === credential?.connectionId) + record.connectionLabel = connection?.theirLabel return record } } diff --git a/ios/AdeyaWallet.xcodeproj/project.pbxproj b/ios/AdeyaWallet.xcodeproj/project.pbxproj index f4b4172c..39351130 100644 --- a/ios/AdeyaWallet.xcodeproj/project.pbxproj +++ b/ios/AdeyaWallet.xcodeproj/project.pbxproj @@ -507,7 +507,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements; - CURRENT_PROJECT_VERSION = 42; + CURRENT_PROJECT_VERSION = 43; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = Z5W7KRPGHZ; ENABLE_BITCODE = NO; @@ -545,7 +545,7 @@ CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 42; + CURRENT_PROJECT_VERSION = 43; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = Z5W7KRPGHZ; INFOPLIST_FILE = AdeyaWallet/Info.plist;