diff --git a/lib/utils/action-utils.js b/lib/utils/action-utils.js --- a/lib/utils/action-utils.js +++ b/lib/utils/action-utils.js @@ -361,13 +361,13 @@ export type ActionFunc = (callServerEndpoint: CallServerEndpoint) => F; export type BindServerCall = (serverCall: ActionFunc) => F; -type BindServerCallsParams = { - dispatch: Dispatch, - cookie: ?string, - urlPrefix: string, - sessionID: ?string, - currentUserInfo: ?CurrentUserInfo, - connectionStatus: ConnectionStatus, +export type BindServerCallsParams = { + +dispatch: Dispatch, + +cookie: ?string, + +urlPrefix: string, + +sessionID: ?string, + +currentUserInfo: ?CurrentUserInfo, + +connectionStatus: ConnectionStatus, }; // All server calls needs to include some information from the Redux state 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 @@ -135,7 +135,18 @@ }); }, [navigate, params]); - const exactSearchUserCall = useServerCall(exactSearchUser); + const { keyserverURL } = userSelections; + const serverCallParamOverride = React.useMemo( + () => ({ + urlPrefix: keyserverURL, + }), + [keyserverURL], + ); + + const exactSearchUserCall = useServerCall( + exactSearchUser, + serverCallParamOverride, + ); const dispatchActionPromise = useDispatchActionPromise(); const cacheContext = React.useContext(ENSCacheContext); @@ -215,6 +226,7 @@ closing={panelState === 'closing'} onSuccessfulWalletSignature={onSuccessfulWalletSignature} setLoading={siwePanelSetLoading} + keyserverCallParamOverride={serverCallParamOverride} /> ); } 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 @@ -67,10 +67,21 @@ return true; }, [validUsername]); - const exactSearchUserCall = useServerCall(exactSearchUser); + const { userSelections } = props.route.params; + const { keyserverURL } = userSelections; + const serverCallParamOverride = React.useMemo( + () => ({ + urlPrefix: keyserverURL, + }), + [keyserverURL], + ); + + const exactSearchUserCall = useServerCall( + exactSearchUser, + serverCallParamOverride, + ); const dispatchActionPromise = useDispatchActionPromise(); const { navigate } = props.navigation; - const { userSelections } = props.route.params; const onProceed = React.useCallback(async () => { if (!checkUsernameValidity()) { return; diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js --- a/native/account/siwe-panel.react.js +++ b/native/account/siwe-panel.react.js @@ -16,6 +16,7 @@ import { useServerCall, useDispatchActionPromise, + type BindServerCallsParams, } from 'lib/utils/action-utils.js'; import { commCoreModule } from '../native-modules.js'; @@ -36,10 +37,14 @@ +onSuccessfulWalletSignature: SIWEResult => mixed, +closing: boolean, +setLoading: boolean => mixed, + +keyserverCallParamOverride?: $Shape, }; function SIWEPanel(props: Props): React.Node { const dispatchActionPromise = useDispatchActionPromise(); - const getSIWENonceCall = useServerCall(getSIWENonce); + const getSIWENonceCall = useServerCall( + getSIWENonce, + props.keyserverCallParamOverride, + ); const getSIWENonceCallFailed = useSelector( state => getSIWENonceLoadingStatusSelector(state) === 'error',