Page MenuHomePhabricator

D14164.id46555.diff
No OneTemporary

D14164.id46555.diff

diff --git a/native/account/registration/siwe-backup-message-creation.react.js b/native/account/registration/siwe-backup-message-creation.react.js
--- a/native/account/registration/siwe-backup-message-creation.react.js
+++ b/native/account/registration/siwe-backup-message-creation.react.js
@@ -24,6 +24,7 @@
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import Alert from '../../utils/alert.js';
+import PromptButton from '../prompt-button.react.js';
import { useSIWEPanelState } from '../siwe-hooks.js';
import SIWEPanel from '../siwe-panel.react.js';
@@ -243,7 +244,6 @@
siweNonce,
siweStatement,
onSuccessfulWalletSignature,
- onSkip,
} = props;
const siweSignatureRequestData = React.useMemo(
() => ({
@@ -283,12 +283,13 @@
</View>
</RegistrationContentContainer>
<RegistrationButtonContainer>
- <PrimaryButton
- onPress={openPanel}
- label="Decrypt with Ethereum signature"
- variant="enabled"
- />
- <PrimaryButton onPress={onSkip} label="Skip" variant="outline" />
+ <View style={styles.buttonContainer}>
+ <PromptButton
+ onPress={openPanel}
+ text="Decrypt with Ethereum signature"
+ variant={panelState === 'opening' ? 'loading' : 'enabled'}
+ />
+ </View>
</RegistrationButtonContainer>
</RegistrationContainer>
{siwePanel}
@@ -320,6 +321,9 @@
alignItems: 'center',
justifyContent: 'center',
},
+ buttonContainer: {
+ flexDirection: 'row',
+ },
};
export {
diff --git a/native/account/sign-in-navigator.react.js b/native/account/sign-in-navigator.react.js
--- a/native/account/sign-in-navigator.react.js
+++ b/native/account/sign-in-navigator.react.js
@@ -11,6 +11,7 @@
import RestoreBackupScreen from './restore-backup-screen.react.js';
import RestorePasswordAccountScreen from './restore-password-account-screen.react.js';
import RestorePromptScreen from './restore-prompt-screen.react.js';
+import RestoreSIWEBackup from '../backup/restore-siwe-backup.react.js';
import type { RootNavigationProp } from '../navigation/root-navigator.react.js';
import {
type ScreenParamList,
@@ -19,6 +20,7 @@
RestorePromptScreenRouteName,
RestorePasswordAccountScreenRouteName,
RestoreBackupScreenRouteName,
+ RestoreSIWEBackupRouteName,
} from '../navigation/route-names.js';
import { useColors } from '../themes/colors.js';
@@ -71,6 +73,10 @@
name={RestoreBackupScreenRouteName}
component={RestoreBackupScreen}
/>
+ <SignInStack.Screen
+ name={RestoreSIWEBackupRouteName}
+ component={RestoreSIWEBackup}
+ />
</SignInStack.Navigator>
);
}
diff --git a/native/backup/restore-siwe-backup.react.js b/native/backup/restore-siwe-backup.react.js
--- a/native/backup/restore-siwe-backup.react.js
+++ b/native/backup/restore-siwe-backup.react.js
@@ -2,7 +2,6 @@
import * as React from 'react';
import { Alert } from 'react-native';
-import { SafeAreaView } from 'react-native-safe-area-context';
import { type SIWEResult } from 'lib/types/siwe-types.js';
import { getMessageForException } from 'lib/utils/errors.js';
@@ -13,7 +12,6 @@
import { type RootNavigationProp } from '../navigation/root-navigator.react.js';
import { type NavigationRoute } from '../navigation/route-names.js';
import { persistConfig } from '../redux/persist.js';
-import { useStyles } from '../themes/colors.js';
export type RestoreSIWEBackupParams = {
+backupID: string,
@@ -29,7 +27,6 @@
};
function RestoreSIWEBackup(props: Props): React.Node {
- const styles = useStyles(unboundStyles);
const { goBack } = props.navigation;
const { route } = props;
const {
@@ -75,25 +72,14 @@
);
return (
- <SafeAreaView edges={safeAreaEdges} style={styles.container}>
- <SignSIWEBackupMessageForRestore
- siweNonce={siweNonce}
- siweStatement={siweStatement}
- siweIssuedAt={siweIssuedAt}
- onSkip={goBack}
- onSuccessfulWalletSignature={onSuccessfulWalletSignature}
- />
- </SafeAreaView>
+ <SignSIWEBackupMessageForRestore
+ siweNonce={siweNonce}
+ siweStatement={siweStatement}
+ siweIssuedAt={siweIssuedAt}
+ onSkip={goBack}
+ onSuccessfulWalletSignature={onSuccessfulWalletSignature}
+ />
);
}
-const safeAreaEdges = ['top'];
-const unboundStyles = {
- container: {
- flex: 1,
- backgroundColor: 'panelBackground',
- justifyContent: 'space-between',
- },
-};
-
export default RestoreSIWEBackup;
diff --git a/native/navigation/root-navigator.react.js b/native/navigation/root-navigator.react.js
--- a/native/navigation/root-navigator.react.js
+++ b/native/navigation/root-navigator.react.js
@@ -55,7 +55,6 @@
ConnectFarcasterBottomSheetRouteName,
TagFarcasterChannelNavigatorRouteName,
CreateMissingSIWEBackupMessageRouteName,
- RestoreSIWEBackupRouteName,
LinkedDevicesBottomSheetRouteName,
} from './route-names.js';
import LoggedOutModal from '../account/logged-out-modal.react.js';
@@ -63,7 +62,6 @@
import RegistrationNavigator from '../account/registration/registration-navigator.react.js';
import SignInNavigator from '../account/sign-in-navigator.react.js';
import TermsAndPrivacyModal from '../account/terms-and-privacy-modal.react.js';
-import RestoreSIWEBackup from '../backup/restore-siwe-backup.react.js';
import ThreadPickerModal from '../calendar/thread-picker-modal.react.js';
import ImagePasteModal from '../chat/image-paste-modal.react.js';
import MessageReactionsModal from '../chat/message-reactions-modal.react.js';
@@ -312,10 +310,6 @@
name={CreateMissingSIWEBackupMessageRouteName}
component={CreateMissingSIWEBackupMessage}
/>
- <Root.Screen
- name={RestoreSIWEBackupRouteName}
- component={RestoreSIWEBackup}
- />
</Root.Navigator>
);
}
diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js
--- a/native/navigation/route-names.js
+++ b/native/navigation/route-names.js
@@ -206,7 +206,6 @@
+ConnectFarcasterBottomSheet: void,
+TagFarcasterChannelNavigator: void,
+CreateMissingSIWEBackupMessage: void,
- +RestoreSIWEBackup: RestoreSIWEBackupParams,
};
export type NUXTipRouteNames =
@@ -343,6 +342,7 @@
+RestorePromptScreen: void,
+RestorePasswordAccountScreen: void,
+RestoreBackupScreen: RestoreBackupScreenParams,
+ +RestoreSIWEBackup: RestoreSIWEBackupParams,
};
export type UserProfileBottomSheetParamList = {
diff --git a/native/profile/backup-menu.react.js b/native/profile/backup-menu.react.js
--- a/native/profile/backup-menu.react.js
+++ b/native/profile/backup-menu.react.js
@@ -229,8 +229,7 @@
const testRestoreForSIWEUser = React.useCallback(async () => {
let message = 'success';
try {
- const { siweBackupData, backupID } =
- await retrieveLatestBackupInfo(userIdentifier);
+ const { siweBackupData } = await retrieveLatestBackupInfo(userIdentifier);
if (!siweBackupData) {
throw new Error('Missing SIWE message for Wallet user backup');
@@ -245,11 +244,11 @@
navigation.navigate<'RestoreSIWEBackup'>({
name: RestoreSIWEBackupRouteName,
params: {
- backupID,
siweNonce: siweBackupMsgNonce,
siweStatement: siweBackupMsgStatement,
siweIssuedAt: siweBackupMsgIssuedAt,
userIdentifier,
+ signature: '',
},
});
} catch (e) {

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 6:18 AM (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675671
Default Alt Text
D14164.id46555.diff (7 KB)

Event Timeline