Page MenuHomePhabricator

D11972.id40019.diff
No OneTemporary

D11972.id40019.diff

diff --git a/native/account/registration/account-does-not-exist.react.js b/native/account/registration/account-does-not-exist.react.js
--- a/native/account/registration/account-does-not-exist.react.js
+++ b/native/account/registration/account-does-not-exist.react.js
@@ -11,7 +11,7 @@
import commSwooshSource from '../../img/comm-swoosh.png';
import {
type NavigationRoute,
- CoolOrNerdModeSelectionRouteName,
+ ConnectEthereumRouteName,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
@@ -22,7 +22,7 @@
function AccountDoesNotExist(props: Props): React.Node {
const { navigate } = props.navigation;
const onSubmit = React.useCallback(() => {
- navigate(CoolOrNerdModeSelectionRouteName);
+ navigate(ConnectEthereumRouteName);
}, [navigate]);
const styles = useStyles(unboundStyles);
diff --git a/native/account/registration/avatar-selection.react.js b/native/account/registration/avatar-selection.react.js
--- a/native/account/registration/avatar-selection.react.js
+++ b/native/account/registration/avatar-selection.react.js
@@ -36,8 +36,8 @@
export type AvatarSelectionParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+accountSelection: AccountSelection,
+farcasterID: ?string,
},
diff --git a/native/account/registration/connect-ethereum.react.js b/native/account/registration/connect-ethereum.react.js
--- a/native/account/registration/connect-ethereum.react.js
+++ b/native/account/registration/connect-ethereum.react.js
@@ -30,6 +30,7 @@
} from '../../navigation/route-names.js';
import { useSelector } from '../../redux/redux-utils.js';
import { useStyles } from '../../themes/colors.js';
+import { defaultURLPrefix } from '../../utils/url-utils.js';
import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js';
import SIWEPanel from '../siwe-panel.react.js';
@@ -37,8 +38,8 @@
exactSearchUserActionTypes,
);
-export type ConnectEthereumParams = {
- +userSelections: {
+export type ConnectEthereumParams = ?{
+ +userSelections?: {
+coolOrNerdMode: CoolOrNerdMode,
+keyserverURL: string,
},
@@ -52,13 +53,13 @@
};
function ConnectEthereum(props: Props): React.Node {
const { params } = props.route;
- const { userSelections } = params;
const registrationContext = React.useContext(RegistrationContext);
invariant(registrationContext, 'registrationContext should be set');
const { cachedSelections } = registrationContext;
- const isNerdMode = userSelections.coolOrNerdMode === 'nerd';
+ const userSelections = params?.userSelections;
+ const isNerdMode = userSelections?.coolOrNerdMode === 'nerd';
const styles = useStyles(unboundStyles);
let body;
@@ -127,11 +128,15 @@
const onSkip = React.useCallback(() => {
navigate<'ConnectFarcaster'>({
name: ConnectFarcasterRouteName,
- params,
+ params: {
+ userSelections: {
+ ...userSelections,
+ },
+ },
});
- }, [navigate, params]);
+ }, [navigate, userSelections]);
- const { keyserverURL } = userSelections;
+ const keyserverURL = userSelections?.keyserverURL ?? defaultURLPrefix;
const serverCallParamOverride = React.useMemo(
() => ({
urlPrefix: keyserverURL,
diff --git a/native/account/registration/connect-farcaster.react.js b/native/account/registration/connect-farcaster.react.js
--- a/native/account/registration/connect-farcaster.react.js
+++ b/native/account/registration/connect-farcaster.react.js
@@ -28,8 +28,8 @@
export type ConnectFarcasterParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+ethereumAccount?: EthereumAccountSelection,
},
};
diff --git a/native/account/registration/password-selection.react.js b/native/account/registration/password-selection.react.js
--- a/native/account/registration/password-selection.react.js
+++ b/native/account/registration/password-selection.react.js
@@ -23,8 +23,8 @@
export type PasswordSelectionParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+farcasterID: ?string,
+username: string,
},
diff --git a/native/account/registration/registration-navigator.react.js b/native/account/registration/registration-navigator.react.js
--- a/native/account/registration/registration-navigator.react.js
+++ b/native/account/registration/registration-navigator.react.js
@@ -70,7 +70,10 @@
// eslint-disable-next-line no-unused-vars
function RegistrationNavigator(props: Props): React.Node {
return (
- <Registration.Navigator screenOptions={screenOptions}>
+ <Registration.Navigator
+ screenOptions={screenOptions}
+ initialRouteName={ConnectEthereumRouteName}
+ >
<Registration.Screen
name={CoolOrNerdModeSelectionRouteName}
component={CoolOrNerdModeSelection}
diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js
--- a/native/account/registration/registration-server-call.js
+++ b/native/account/registration/registration-server-call.js
@@ -46,6 +46,7 @@
UnknownErrorAlertDetails,
} from '../../utils/alert-messages.js';
import Alert from '../../utils/alert.js';
+import { defaultURLPrefix } from '../../utils/url-utils.js';
import { setNativeCredentials } from '../native-credentials.js';
import {
useLegacySIWEServerCall,
@@ -214,11 +215,12 @@
const {
accountSelection,
avatarData,
- keyserverURL,
+ keyserverURL: passedKeyserverURL,
farcasterID,
siweBackupSecrets,
clearCachedSelections,
} = input;
+ const keyserverURL = passedKeyserverURL ?? defaultURLPrefix;
if (
accountSelection.accountType === 'username' &&
!usingCommServicesAccessToken
@@ -260,10 +262,12 @@
throw e;
}
}
- dispatch({
- type: setURLPrefix,
- payload: keyserverURL,
- });
+ if (passedKeyserverURL) {
+ dispatch({
+ type: setURLPrefix,
+ payload: passedKeyserverURL,
+ });
+ }
if (farcasterID) {
dispatch({
type: setSyncedMetadataEntryActionType,
diff --git a/native/account/registration/registration-terms.react.js b/native/account/registration/registration-terms.react.js
--- a/native/account/registration/registration-terms.react.js
+++ b/native/account/registration/registration-terms.react.js
@@ -24,8 +24,8 @@
export type RegistrationTermsParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+farcasterID: ?string,
+accountSelection: AccountSelection,
+avatarData: ?AvatarData,
diff --git a/native/account/registration/registration-types.js b/native/account/registration/registration-types.js
--- a/native/account/registration/registration-types.js
+++ b/native/account/registration/registration-types.js
@@ -38,8 +38,8 @@
};
export type RegistrationServerCallInput = {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+farcasterID: ?string,
+accountSelection: AccountSelection,
+avatarData: ?AvatarData,
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
@@ -140,8 +140,8 @@
export type CreateSIWEBackupMessageParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+farcasterID: ?string,
+accountSelection: AccountSelection,
+avatarData: ?AvatarData,
diff --git a/native/account/registration/username-selection.react.js b/native/account/registration/username-selection.react.js
--- a/native/account/registration/username-selection.react.js
+++ b/native/account/registration/username-selection.react.js
@@ -37,8 +37,8 @@
export type UsernameSelectionParams = {
+userSelections: {
- +coolOrNerdMode: CoolOrNerdMode,
- +keyserverURL: string,
+ +coolOrNerdMode?: CoolOrNerdMode,
+ +keyserverURL?: string,
+farcasterID: ?string,
},
};

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 1:28 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534983
Default Alt Text
D11972.id40019.diff (8 KB)

Event Timeline