Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3493576
D6672.id22314.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.id22314.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';
@@ -50,13 +51,11 @@
};
type Props = {
...BaseProps,
- // Redux state
+loadingStatus: LoadingStatus,
+logInExtraInfo: () => LogInExtraInfo,
- // Redux dispatch functions
+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 +367,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
Fri, Dec 20, 3:42 AM (17 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2679319
Default Alt Text
D6672.id22314.diff (1 KB)
Attached To
Mode
D6672: [native] Get `primaryIdentityPublicKey` before enabling `LogInPanel`
Attached
Detach File
Event Timeline
Log In to Comment