Re-applied formatting fixes.

pull/1587/head
Warrick Corfe-Tan 5 years ago
parent 56b8dfacc1
commit 6079f43cd8

@ -37,7 +37,7 @@ class SessionPasswordModalInner extends React.Component<Props, State> {
error: null, error: null,
currentPasswordEntered: null, currentPasswordEntered: null,
currentPasswordConfirmEntered: null, currentPasswordConfirmEntered: null,
currentPasswordRetypeEntered: null currentPasswordRetypeEntered: null,
}; };
this.showError = this.showError.bind(this); this.showError = this.showError.bind(this);
@ -61,7 +61,11 @@ class SessionPasswordModalInner extends React.Component<Props, State> {
const { action, onOk } = this.props; const { action, onOk } = this.props;
const placeholders = const placeholders =
action === PasswordAction.Change action === PasswordAction.Change
? [window.i18n('typeInOldPassword'), window.i18n('enterPassword'), window.i18n('confirmPassword')] ? [
window.i18n('typeInOldPassword'),
window.i18n('enterPassword'),
window.i18n('confirmPassword'),
]
: [window.i18n('enterPassword'), window.i18n('confirmPassword')]; : [window.i18n('enterPassword'), window.i18n('confirmPassword')];
const confirmButtonColor = const confirmButtonColor =
@ -196,7 +200,11 @@ class SessionPasswordModalInner extends React.Component<Props, State> {
this.closeDialog(); this.closeDialog();
} }
private async handleActionChange(oldPassword: string, newPassword: string, newConfirmedPassword: string) { private async handleActionChange(
oldPassword: string,
newPassword: string,
newConfirmedPassword: string
) {
// We don't validate oldPassword on change: this is validate on the validatePasswordHash below // We don't validate oldPassword on change: this is validate on the validatePasswordHash below
// we only validate the newPassword here // we only validate the newPassword here
if (!this.validatePassword(newPassword)) { if (!this.validatePassword(newPassword)) {
@ -206,9 +214,9 @@ class SessionPasswordModalInner extends React.Component<Props, State> {
// Check the retyped password matches the new password // Check the retyped password matches the new password
if (newPassword !== newConfirmedPassword) { if (newPassword !== newConfirmedPassword) {
this.setState({ this.setState({
error: window.i18n('passwordsDoNotMatch') error: window.i18n('passwordsDoNotMatch'),
}) });
return return;
} }
const isValidWithStoredInDB = Boolean( const isValidWithStoredInDB = Boolean(
@ -262,7 +270,7 @@ class SessionPasswordModalInner extends React.Component<Props, State> {
const { const {
currentPasswordEntered, currentPasswordEntered,
currentPasswordConfirmEntered, currentPasswordConfirmEntered,
currentPasswordRetypeEntered currentPasswordRetypeEntered,
} = this.state; } = this.state;
const { Set, Remove, Change } = PasswordAction; const { Set, Remove, Change } = PasswordAction;

Loading…
Cancel
Save