Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2839871
D12682.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D12682.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12682: [native][web] Stop clearing user input on unknown error
Attached
Detach File
Event Timeline
Log In to Comment