diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js --- a/native/account/log-in-panel.react.js +++ b/native/account/log-in-panel.react.js @@ -26,6 +26,7 @@ } from 'lib/utils/action-utils'; import SWMansionIcon from '../components/swmansion-icon.react'; +import { commCoreModule } from '../native-modules'; import { NavContext } from '../navigation/navigation-context'; import { useSelector } from '../redux/redux-utils'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors'; @@ -57,6 +58,7 @@ +dispatchActionPromise: DispatchActionPromise, // async functions that hit server APIs +logIn: (logInInfo: LogInInfo) => Promise, + +primaryIdentityPublicKey: ?string, }; class LogInPanel extends React.PureComponent { usernameInput: ?TextInput; @@ -368,13 +370,26 @@ const dispatchActionPromise = useDispatchActionPromise(); const callLogIn = useServerCall(logIn); + const [ + primaryIdentityPublicKey, + setPrimaryIdentityPublicKey, + ] = React.useState(null); + React.useEffect(() => { + (async () => { + await commCoreModule.initializeCryptoAccount('PLACEHOLDER'); + const { ed25519 } = await commCoreModule.getUserPublicKey(); + setPrimaryIdentityPublicKey(ed25519); + })(); + }, []); + return ( ); },