mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
agent feedback (#1744)
This commit is contained in:
@@ -137,6 +137,8 @@ const UnregisteredIdCard: FC<UnregisteredIdCardProps> = ({
|
||||
justifyContent="center"
|
||||
onPress={onRegisterPress}
|
||||
pressStyle={{ opacity: 0.7 }}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Complete Registration"
|
||||
>
|
||||
<Text
|
||||
fontFamily={dinot}
|
||||
|
||||
@@ -81,11 +81,31 @@ export function usePendingKycRecovery() {
|
||||
hasAttemptedRecoveryRef.current.add(processingWithDocument.userId);
|
||||
return;
|
||||
}
|
||||
// Navigation not ready yet - don't mark as attempted, allow retry
|
||||
|
||||
// Navigation not ready yet - poll until ready
|
||||
console.log(
|
||||
'[PendingKycRecovery] Navigation not ready, will retry recovery for:',
|
||||
'[PendingKycRecovery] Navigation not ready, polling for readiness:',
|
||||
processingWithDocument.userId,
|
||||
);
|
||||
|
||||
const pollInterval = setInterval(() => {
|
||||
if (navigationRef.isReady()) {
|
||||
console.log(
|
||||
'[PendingKycRecovery] Navigation ready, navigating for:',
|
||||
processingWithDocument.userId,
|
||||
);
|
||||
navigationRef.navigate('KYCVerified', {
|
||||
documentId: processingWithDocument.documentId,
|
||||
});
|
||||
hasAttemptedRecoveryRef.current.add(processingWithDocument.userId);
|
||||
clearInterval(pollInterval);
|
||||
}
|
||||
}, 100); // Poll every 100ms
|
||||
|
||||
// Cleanup polling on unmount or dependency change
|
||||
return () => {
|
||||
clearInterval(pollInterval);
|
||||
};
|
||||
}
|
||||
|
||||
const firstPending = pendingVerifications.find(
|
||||
|
||||
@@ -64,16 +64,41 @@ const DevSettingsScreen: React.FC = () => {
|
||||
text: 'Remove',
|
||||
style: 'destructive',
|
||||
onPress: async () => {
|
||||
const catalog = await loadDocumentCatalogDirectlyFromKeychain();
|
||||
const selectedDocumentId = catalog.selectedDocumentId;
|
||||
const selectedDocument = catalog.documents.find(
|
||||
document => document.id === selectedDocumentId,
|
||||
);
|
||||
try {
|
||||
const catalog = await loadDocumentCatalogDirectlyFromKeychain();
|
||||
const selectedDocumentId = catalog.selectedDocumentId;
|
||||
const selectedDocument = catalog.documents.find(
|
||||
document => document.id === selectedDocumentId,
|
||||
);
|
||||
|
||||
if (!selectedDocument) {
|
||||
Alert.alert(
|
||||
'No Document Selected',
|
||||
'Please select a document before removing the expiration date flag.',
|
||||
[{ text: 'OK' }],
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedDocument) {
|
||||
delete selectedDocument.hasExpirationDate;
|
||||
|
||||
await saveDocumentCatalogDirectlyToKeychain(catalog);
|
||||
|
||||
Alert.alert(
|
||||
'Success',
|
||||
'Expiration date flag removed successfully.',
|
||||
[{ text: 'OK' }],
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'Failed to remove expiration date flag:',
|
||||
error instanceof Error ? error.message : String(error),
|
||||
);
|
||||
Alert.alert(
|
||||
'Error',
|
||||
'Failed to remove expiration date flag. Please try again.',
|
||||
[{ text: 'OK' }],
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
|
||||
|
||||
import React, { useCallback, useEffect, useRef } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { Image, StyleSheet } from 'react-native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { ScrollView, Text, View, XStack, YStack } from 'tamagui';
|
||||
@@ -96,7 +96,10 @@ const PointsInfoScreen: React.FC<PointsInfoScreenProps> = ({
|
||||
}) => {
|
||||
const { showNextButton, callbackId } = params || {};
|
||||
const { left, right, bottom } = useSafeAreaInsets();
|
||||
const callbacks = callbackId ? getModalCallbacks(callbackId) : undefined;
|
||||
const callbacks = useMemo(
|
||||
() => (callbackId ? getModalCallbacks(callbackId) : undefined),
|
||||
[callbackId],
|
||||
);
|
||||
const buttonPressedRef = useRef(false);
|
||||
|
||||
// Handle button press: mark as pressed and call the callback
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
|
||||
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { YStack } from 'tamagui';
|
||||
@@ -33,11 +33,18 @@ const KYCVerifiedScreen: React.FC = () => {
|
||||
const selfClient = useSelfClient();
|
||||
const { pendingVerifications, removePendingVerification } =
|
||||
usePendingKycStore();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const documentId = route.params?.documentId;
|
||||
|
||||
const handleGenerateProof = async () => {
|
||||
// Prevent multiple concurrent proof generations
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
buttonTap();
|
||||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
if (!documentId) {
|
||||
@@ -83,6 +90,8 @@ const KYCVerifiedScreen: React.FC = () => {
|
||||
selfClient.emit(SdkEvents.DOCUMENT_OWNERSHIP_CONFIRMED, documentMetadata);
|
||||
} catch (err) {
|
||||
console.error('[KYCVerifiedScreen] Failed to trigger registration:', err);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,8 +116,9 @@ const KYCVerifiedScreen: React.FC = () => {
|
||||
bgColor={white}
|
||||
color={black}
|
||||
onPress={handleGenerateProof}
|
||||
disabled={isLoading}
|
||||
>
|
||||
Generate proof
|
||||
{isLoading ? 'Generating...' : 'Generate proof'}
|
||||
</AbstractButton>
|
||||
</YStack>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user