mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 23:27:56 -05:00
fix: mark document as registered after restoring secret (#1350)
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user