fix: mark document as registered after restoring secret (#1350)

This commit is contained in:
Seshanth.S
2025-11-06 12:15:43 +05:30
committed by GitHub
parent 7ca75b72ff
commit a2a6a0cbcb
2 changed files with 12 additions and 2 deletions

View File

@@ -8,7 +8,10 @@ import { useNavigation } from '@react-navigation/native';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { isUserRegisteredWithAlternativeCSCA } from '@selfxyz/common/utils/passports/validate';
import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import {
markCurrentDocumentAsRegistered,
useSelfClient,
} from '@selfxyz/mobile-sdk-alpha';
import {
Caption,
Description,
@@ -98,6 +101,7 @@ const AccountRecoveryChoiceScreen: React.FC = () => {
toggleCloudBackupEnabled();
}
reStorePassportDataWithRightCSCA(passportData, csca as string);
await markCurrentDocumentAsRegistered(selfClient);
trackEvent(BackupEvents.CLOUD_RESTORE_SUCCESS);
trackEvent(BackupEvents.ACCOUNT_RECOVERY_COMPLETED);
onRestoreFromCloudNext();
@@ -117,6 +121,7 @@ const AccountRecoveryChoiceScreen: React.FC = () => {
navigation,
toggleCloudBackupEnabled,
useProtocolStore,
selfClient,
]);
const handleManualRecoveryPress = useCallback(() => {

View File

@@ -11,7 +11,10 @@ import { useNavigation } from '@react-navigation/native';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { isUserRegisteredWithAlternativeCSCA } from '@selfxyz/common/utils/passports/validate';
import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import {
markCurrentDocumentAsRegistered,
useSelfClient,
} from '@selfxyz/mobile-sdk-alpha';
import {
Description,
SecondaryButton,
@@ -100,12 +103,14 @@ const RecoverWithPhraseScreen: React.FC = () => {
}
setRestoring(false);
await markCurrentDocumentAsRegistered(selfClient);
trackEvent(BackupEvents.ACCOUNT_RECOVERY_COMPLETED);
navigation.navigate('AccountVerifiedSuccess');
}, [
mnemonic,
navigation,
restoreAccountFromMnemonic,
selfClient,
trackEvent,
useProtocolStore,
]);