diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -111,7 +111,6 @@ +username: string, +password: string, +logInActionSource: LogInActionSource, - +primaryIdentityPublicKey?: string, }; export type LogInRequest = { 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 @@ -33,7 +33,6 @@ import { PanelButton, Panel } from './panel-components.react.js'; import PasswordInput from './password-input.react.js'; import SWMansionIcon from '../components/swmansion-icon.react.js'; -import { commCoreModule } from '../native-modules.js'; import { NavContext } from '../navigation/navigation-context.js'; import { useSelector } from '../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js'; @@ -55,7 +54,6 @@ +logInExtraInfo: () => Promise, +dispatchActionPromise: DispatchActionPromise, +logIn: (logInInfo: LogInInfo) => Promise, - +primaryIdentityPublicKey: ?string, }; class LogInPanel extends React.PureComponent { usernameInput: ?TextInput; @@ -152,10 +150,6 @@ text="LOG IN" loadingStatus={this.props.loadingStatus} onSubmit={this.onSubmit} - disabled={ - this.props.primaryIdentityPublicKey === undefined || - this.props.primaryIdentityPublicKey === null - } /> @@ -242,19 +236,12 @@ }; async logInAction(extraInfo: LogInExtraInfo): Promise { - const { primaryIdentityPublicKey } = this.props; try { - invariant( - primaryIdentityPublicKey !== null && - primaryIdentityPublicKey !== undefined, - 'primaryIdentityPublicKey must exist in logInAction', - ); const result = await this.props.logIn({ ...extraInfo, username: this.usernameInputText, password: this.passwordInputText, logInActionSource: logInActionSources.logInFromNativeForm, - primaryIdentityPublicKey: primaryIdentityPublicKey, }); this.props.setActiveAlert(false); await setNativeCredentials({ @@ -378,18 +365,6 @@ 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 ( ); }, diff --git a/native/account/register-panel.react.js b/native/account/register-panel.react.js --- a/native/account/register-panel.react.js +++ b/native/account/register-panel.react.js @@ -33,7 +33,6 @@ import { setNativeCredentials } from './native-credentials.js'; import { PanelButton, Panel } from './panel-components.react.js'; import SWMansionIcon from '../components/swmansion-icon.react.js'; -import { commCoreModule } from '../native-modules.js'; import { NavContext } from '../navigation/navigation-context.js'; import { useSelector } from '../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js'; @@ -56,7 +55,6 @@ +logInExtraInfo: () => Promise, +dispatchActionPromise: DispatchActionPromise, +register: (registerInfo: RegisterInfo) => Promise, - +primaryIdentityPublicKey: ?string, }; type State = { +confirmPasswordFocused: boolean, @@ -181,10 +179,6 @@ text="SIGN UP" loadingStatus={this.props.loadingStatus} onSubmit={this.onSubmit} - disabled={ - this.props.primaryIdentityPublicKey === undefined || - this.props.primaryIdentityPublicKey === null - } /> @@ -332,18 +326,11 @@ }; async registerAction(extraInfo: LogInExtraInfo) { - const { primaryIdentityPublicKey } = this.props; try { - invariant( - primaryIdentityPublicKey !== null && - primaryIdentityPublicKey !== undefined, - 'primaryIdentityPublicKey must exist in logInAction', - ); const result = await this.props.register({ ...extraInfo, username: this.props.registerState.state.usernameInputText, password: this.props.registerState.state.passwordInputText, - primaryIdentityPublicKey: primaryIdentityPublicKey, }); this.props.setActiveAlert(false); await setNativeCredentials({ @@ -471,18 +458,6 @@ const dispatchActionPromise = useDispatchActionPromise(); const callRegister = useServerCall(register); - const [ - primaryIdentityPublicKey, - setPrimaryIdentityPublicKey, - ] = React.useState(null); - React.useEffect(() => { - (async () => { - await commCoreModule.initializeCryptoAccount('PLACEHOLDER'); - const { ed25519 } = await commCoreModule.getUserPublicKey(); - setPrimaryIdentityPublicKey(ed25519); - })(); - }, []); - return ( ); },