Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3246886
D6672.id22312.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6672.id22312.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6672: [native] Get `primaryIdentityPublicKey` before enabling `LogInPanel`
Attached
Detach File
Event Timeline
Log In to Comment