Page MenuHomePhabricator

D6672.id22312.diff
No OneTemporary

D6672.id22312.diff

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<LogInResult>,
+ +primaryIdentityPublicKey: ?string,
};
class LogInPanel extends React.PureComponent<Props> {
usernameInput: ?TextInput;
@@ -368,13 +370,26 @@
const dispatchActionPromise = useDispatchActionPromise();
const callLogIn = useServerCall(logIn);
+ const [
+ primaryIdentityPublicKey,
+ setPrimaryIdentityPublicKey,
+ ] = React.useState<?string>(null);
+ React.useEffect(() => {
+ (async () => {
+ await commCoreModule.initializeCryptoAccount('PLACEHOLDER');
+ const { ed25519 } = await commCoreModule.getUserPublicKey();
+ setPrimaryIdentityPublicKey(ed25519);
+ })();
+ }, []);
+
return (
<LogInPanel
{...props}
- loadingStatus={loadingStatus}
+ loadingStatus={!primaryIdentityPublicKey ? 'loading' : loadingStatus}
logInExtraInfo={logInExtraInfo}
dispatchActionPromise={dispatchActionPromise}
logIn={callLogIn}
+ primaryIdentityPublicKey={primaryIdentityPublicKey}
/>
);
},

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 2:18 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2496117
Default Alt Text
D6672.id22312.diff (1 KB)

Event Timeline