Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351830
D11462.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11462.diff
View Options
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
@@ -1,11 +1,13 @@
// @flow
+import invariant from 'invariant';
import * as React from 'react';
import RegistrationButtonContainer from './registration-button-container.react.js';
import RegistrationButton from './registration-button.react.js';
import RegistrationContainer from './registration-container.react.js';
import RegistrationContentContainer from './registration-content-container.react.js';
+import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type {
CoolOrNerdMode,
@@ -39,6 +41,10 @@
const { navigate } = navigation;
const { params } = route;
+ const registrationContext = React.useContext(RegistrationContext);
+ invariant(registrationContext, 'registrationContext should be set');
+ const { setCachedSelections } = registrationContext;
+
const [webViewState, setWebViewState] =
React.useState<FarcasterWebViewState>('closed');
@@ -78,9 +84,16 @@
const onSkip = React.useCallback(() => goToNextStep(), [goToNextStep]);
- const onSuccess = React.useCallback(() => {
- // TODO: implement onSuccess
- }, []);
+ const onSuccess = React.useCallback(
+ (fid: string) => {
+ goToNextStep(fid);
+ setCachedSelections(oldUserSelections => ({
+ ...oldUserSelections,
+ farcasterID: fid,
+ }));
+ },
+ [goToNextStep, setCachedSelections],
+ );
const onPressConnectFarcaster = React.useCallback(() => {
setWebViewState('opening');
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
@@ -52,6 +52,7 @@
+password?: string,
+avatarData?: ?AvatarData,
+ethereumAccount?: EthereumAccountSelection,
+ +farcasterID?: string,
};
export const ensAvatarSelection: AvatarData = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:46 AM (20 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573755
Default Alt Text
D11462.diff (2 KB)
Attached To
Mode
D11462: [native] implement onSuccess callback for ConnectFarcaster registration step
Attached
Detach File
Event Timeline
Log In to Comment