Page MenuHomePhabricator

D11462.diff
No OneTemporary

D11462.diff

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

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)

Event Timeline