diff --git a/native/account/siwe-hooks.js b/native/account/siwe-hooks.js --- a/native/account/siwe-hooks.js +++ b/native/account/siwe-hooks.js @@ -31,7 +31,7 @@ const siweAuthCall = useServerCall(siweAuth); const callSIWE = React.useCallback( - async (message, signature, extraInfo, options) => { + async (message, signature, extraInfo, callServerEndpointOptions) => { try { return await siweAuthCall( { @@ -39,7 +39,7 @@ signature, ...extraInfo, }, - options, + callServerEndpointOptions, ); } catch (e) { onFailure(); @@ -62,10 +62,12 @@ const dispatchActionPromise = useDispatchActionPromise(); return React.useCallback( - async ({ message, signature }, options) => { + async ({ message, signature }, callServerEndpointOptions) => { const extraInfo = await logInExtraInfo(); const initialNotificationsEncryptedMessage = - await getInitialNotificationsEncryptedMessage(options); + await getInitialNotificationsEncryptedMessage({ + callServerEndpointOptions, + }); const siwePromise = callSIWE( message, @@ -74,7 +76,7 @@ ...extraInfo, initialNotificationsEncryptedMessage, }, - options, + callServerEndpointOptions, ); dispatchActionPromise( diff --git a/native/utils/crypto-utils.js b/native/utils/crypto-utils.js --- a/native/utils/crypto-utils.js +++ b/native/utils/crypto-utils.js @@ -14,8 +14,11 @@ import { commCoreModule } from '../native-modules.js'; +type InitialNotifMessageOptions = { + +callServerEndpointOptions?: ?CallServerEndpointOptions, +}; function useInitialNotificationsEncryptedMessage(): ( - callServerEndpointOptions?: ?CallServerEndpointOptions, + options?: ?InitialNotifMessageOptions, ) => Promise { const callGetOlmSessionInitializationData = useServerCall( getOlmSessionInitializationData, @@ -23,7 +26,8 @@ const dispatchActionPromise = useDispatchActionPromise(); return React.useCallback( - async callServerEndpointOptions => { + async options => { + const callServerEndpointOptions = options?.callServerEndpointOptions; const olmSessionDataPromise = callGetOlmSessionInitializationData( callServerEndpointOptions, );