Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3295685
D11016.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
D11016.diff
View Options
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
@@ -12,6 +12,7 @@
import type { SIWEResult } from 'lib/types/siwe-types.js';
import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
+import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
import { useGetEthereumAccountFromSIWEResult } from './ethereum-utils.js';
import RegistrationButtonContainer from './registration-button-container.react.js';
@@ -21,6 +22,7 @@
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type { CoolOrNerdMode } from './registration-types.js';
+import { commRustModule } from '../../native-modules.js';
import {
type NavigationRoute,
ExistingEthereumAccountRouteName,
@@ -149,12 +151,19 @@
const onSuccessfulWalletSignature = React.useCallback(
async (result: SIWEResult) => {
- const searchPromise = exactSearchUserCall(result.address);
- void dispatchActionPromise(exactSearchUserActionTypes, searchPromise);
-
- const { userInfo } = await searchPromise;
+ let userAlreadyExists;
+ if (usingCommServicesAccessToken) {
+ const findUserIDResponse =
+ await commRustModule.findUserIDForWalletAddress(result.address);
+ userAlreadyExists = JSON.parse(findUserIDResponse).userID !== null;
+ } else {
+ const searchPromise = exactSearchUserCall(result.address);
+ void dispatchActionPromise(exactSearchUserActionTypes, searchPromise);
+ const { userInfo } = await searchPromise;
+ userAlreadyExists = userInfo !== null;
+ }
- if (userInfo) {
+ if (userAlreadyExists) {
navigate<'ExistingEthereumAccount'>({
name: ExistingEthereumAccountRouteName,
params: result,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 10:45 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2532154
Default Alt Text
D11016.diff (2 KB)
Attached To
Mode
D11016: [native] logic for navigating to ExistingEthereumAccount if usingCommServicesAccessToken
Attached
Detach File
Event Timeline
Log In to Comment