diff --git a/native/account/legacy-register-panel.react.js b/native/account/legacy-register-panel.react.js --- a/native/account/legacy-register-panel.react.js +++ b/native/account/legacy-register-panel.react.js @@ -394,7 +394,7 @@ Alert.alert( appOutOfDateAlertDetails.title, appOutOfDateAlertDetails.message, - [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }], + [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }], { cancelable: false }, ); } else { @@ -411,21 +411,6 @@ onUnknownErrorAlertAcknowledged = () => { this.props.setActiveAlert(false); - this.props.legacyRegisterState.setState( - { - usernameInputText: '', - passwordInputText: '', - confirmPasswordInputText: '', - }, - () => { - invariant(this.usernameInput, 'ref should exist'); - this.usernameInput.focus(); - }, - ); - }; - - onAppOutOfDateAlertAcknowledged = () => { - this.props.setActiveAlert(false); }; } 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 @@ -306,7 +306,7 @@ Alert.alert( appOutOfDateAlertDetails.title, appOutOfDateAlertDetails.message, - [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }], + [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }], { cancelable: false }, ); } else { @@ -355,7 +355,7 @@ Alert.alert( appOutOfDateAlertDetails.title, appOutOfDateAlertDetails.message, - [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }], + [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }], { cancelable: false }, ); } else { @@ -405,17 +405,6 @@ onUnknownErrorAlertAcknowledged: () => void = () => { this.props.setActiveAlert(false); - this.props.logInState.setState( - { - usernameInputText: '', - passwordInputText: '', - }, - this.focusUsernameInput, - ); - }; - - onAppOutOfDateAlertAcknowledged: () => void = () => { - this.props.setActiveAlert(false); }; } diff --git a/web/account/traditional-login-form.react.js b/web/account/traditional-login-form.react.js --- a/web/account/traditional-login-form.react.js +++ b/web/account/traditional-login-form.react.js @@ -96,10 +96,10 @@ modalContext.popModal(); return result; } catch (e) { - setUsername(''); - setPassword(''); const messageForException = getMessageForException(e); if (messageForException === 'invalid_credentials') { + setUsername(''); + setPassword(''); setErrorMessage('incorrect username or password'); } else if (messageForException === 'client_version_unsupported') { setErrorMessage(getShortVersionUnsupportedError()); @@ -124,13 +124,13 @@ await callIdentityPasswordLogIn(username, password); modalContext.popModal(); } catch (e) { - setUsername(''); - setPassword(''); const messageForException = getMessageForException(e); if ( messageForException === 'user_not_found' || messageForException === 'login_failed' ) { + setUsername(''); + setPassword(''); setErrorMessage('incorrect username or password'); } else if ( messageForException === 'client_version_unsupported' ||