Page MenuHomePhabricator

D12682.diff
No OneTemporary

D12682.diff

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,14 +394,14 @@
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
- [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
} else {
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
}
@@ -409,22 +409,7 @@
}
}
- onUnknownErrorAlertAcknowledged = () => {
- this.props.setActiveAlert(false);
- this.props.legacyRegisterState.setState(
- {
- usernameInputText: '',
- passwordInputText: '',
- confirmPasswordInputText: '',
- },
- () => {
- invariant(this.usernameInput, 'ref should exist');
- this.usernameInput.focus();
- },
- );
- };
-
- onAppOutOfDateAlertAcknowledged = () => {
+ onOtherErrorAlertAcknowledged = () => {
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,14 +306,14 @@
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
- [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
} else {
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
}
@@ -355,14 +355,14 @@
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
- [{ text: 'OK', onPress: this.onAppOutOfDateAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
} else {
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: this.onUnknownErrorAlertAcknowledged }],
+ [{ text: 'OK', onPress: this.onOtherErrorAlertAcknowledged }],
{ cancelable: false },
);
}
@@ -403,18 +403,7 @@
);
};
- onUnknownErrorAlertAcknowledged: () => void = () => {
- this.props.setActiveAlert(false);
- this.props.logInState.setState(
- {
- usernameInputText: '',
- passwordInputText: '',
- },
- this.focusUsernameInput,
- );
- };
-
- onAppOutOfDateAlertAcknowledged: () => void = () => {
+ onOtherErrorAlertAcknowledged: () => 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' ||

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 30, 3:26 AM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2203622
Default Alt Text
D12682.diff (4 KB)

Event Timeline