diff --git a/app/src/components/homescreen/KycIdCard.tsx b/app/src/components/homescreen/KycIdCard.tsx index efba437c7..00c8337f6 100644 --- a/app/src/components/homescreen/KycIdCard.tsx +++ b/app/src/components/homescreen/KycIdCard.tsx @@ -109,13 +109,25 @@ const KycIdCard: FC = ({ selected, hidden: _hidden, }) => { - // Extract KYC fields from serialized applicant info - const applicantInfo = deserializeApplicantInfo( - idDocument.serializedApplicantInfo, - ); - const country = applicantInfo.country || ''; - const idType = applicantInfo.idType || ''; - const idNumber = applicantInfo.idNumber || ''; + // Extract KYC fields from serialized applicant info with error handling + let country = ''; + let idType = ''; + let idNumber = ''; + + try { + const applicantInfo = deserializeApplicantInfo( + idDocument.serializedApplicantInfo, + ); + country = applicantInfo.country || ''; + idType = applicantInfo.idType || ''; + idNumber = applicantInfo.idNumber || ''; + } catch (error) { + console.error( + '[KycIdCard] Failed to deserialize applicant info, using fallback values:', + error, + ); + // Fallback to safe defaults - component will render generic "ID CARD" display + } const docTitle = getKycDocTitle(idType); const countryAdj = getCountryAdjective(country); diff --git a/app/src/hooks/usePendingKycRecovery.ts b/app/src/hooks/usePendingKycRecovery.ts index 530927840..789253670 100644 --- a/app/src/hooks/usePendingKycRecovery.ts +++ b/app/src/hooks/usePendingKycRecovery.ts @@ -69,7 +69,6 @@ export function usePendingKycRecovery() { ); if (processingWithDocument) { - hasAttemptedRecoveryRef.current.add(processingWithDocument.userId); console.log( '[PendingKycRecovery] Resuming processing verification, navigating to KYCVerified:', processingWithDocument.userId, @@ -78,8 +77,15 @@ export function usePendingKycRecovery() { navigationRef.navigate('KYCVerified', { documentId: processingWithDocument.documentId, }); + // Only mark as attempted after successful navigation + hasAttemptedRecoveryRef.current.add(processingWithDocument.userId); + return; } - return; + // Navigation not ready yet - don't mark as attempted, allow retry + console.log( + '[PendingKycRecovery] Navigation not ready, will retry recovery for:', + processingWithDocument.userId, + ); } const firstPending = pendingVerifications.find( diff --git a/app/src/screens/account/settings/SettingsScreen.tsx b/app/src/screens/account/settings/SettingsScreen.tsx index 5f20555ec..95213876e 100644 --- a/app/src/screens/account/settings/SettingsScreen.tsx +++ b/app/src/screens/account/settings/SettingsScreen.tsx @@ -15,10 +15,10 @@ import { Bug, FileText, Settings2 } from '@tamagui/lucide-icons'; import { BodyText, pressedStyle } from '@selfxyz/mobile-sdk-alpha/components'; import { - amber500, black, neutral700, slate800, + warmCream, white, } from '@selfxyz/mobile-sdk-alpha/constants/colors'; @@ -150,7 +150,7 @@ const SocialButton: React.FC = ({ Icon, href }) => { unstyled hitSlop={8} onPress={onPress} - icon={} + icon={} /> ); }; @@ -309,7 +309,7 @@ const SettingsScreen: React.FC = () => { ))} - + SELF {/* Dont remove if not viewing on ios */} diff --git a/app/src/screens/documents/management/ManageDocumentsScreen.tsx b/app/src/screens/documents/management/ManageDocumentsScreen.tsx index 83e5b5847..a40d1cfda 100644 --- a/app/src/screens/documents/management/ManageDocumentsScreen.tsx +++ b/app/src/screens/documents/management/ManageDocumentsScreen.tsx @@ -159,18 +159,18 @@ const PassportDataSelector = () => { return 'Verified ID'; } - switch (applicantInfo.idType) { - case 'ID_CARD': - return 'ID Card'; - case 'DRIVERS_LICENCE': - return "Driver's Licence"; - case 'PASSPORT': - return 'Passport'; - case 'AADHAAR': - return 'Aadhaar'; - default: - return 'Verified ID'; - } + // Normalize idType for fuzzy matching (handles "drivers_licence", "NATIONAL ID", etc.) + const normalized = applicantInfo.idType + .toLowerCase() + .replace(/[_\s]+/g, ' ') + .trim(); + + if (normalized.includes('driver')) return "Driver's Licence"; + if (normalized.includes('passport')) return 'Passport'; + if (normalized.includes('aadhaar')) return 'Aadhaar'; + if (normalized.includes('national')) return 'National ID'; + if (normalized.includes('residence')) return 'Residence Permit'; + return 'ID Card'; }; const getDisplayName = (metadata: DocumentMetadata): string => { diff --git a/packages/mobile-sdk-alpha/src/constants/colors.ts b/packages/mobile-sdk-alpha/src/constants/colors.ts index d174ad13d..1c6328baa 100644 --- a/packages/mobile-sdk-alpha/src/constants/colors.ts +++ b/packages/mobile-sdk-alpha/src/constants/colors.ts @@ -66,6 +66,8 @@ export const teal500 = '#5EEAD4'; export const textBlack = '#333333'; +export const warmCream = '#F2E3C8'; + export const white = '#ffffff'; export const yellow50 = '#FEFCE8'; diff --git a/packages/mobile-sdk-alpha/src/constants/index.ts b/packages/mobile-sdk-alpha/src/constants/index.ts index b11e10d26..caba4c715 100644 --- a/packages/mobile-sdk-alpha/src/constants/index.ts +++ b/packages/mobile-sdk-alpha/src/constants/index.ts @@ -54,6 +54,7 @@ export { teal300, teal500, textBlack, + warmCream, white, yellow50, yellow500,