From 85fbc6d89ffccac8d7809de07eb1d6338fb03251 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 18 Nov 2020 12:38:56 +0000 Subject: [PATCH] Consolidate PasswordLogin state and input control/ownership previously data was stored in two places which drifted --- src/components/structures/auth/Login.js | 6 +-- src/components/views/auth/PasswordLogin.js | 61 ++++++++-------------- 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index 3aba4a571e..a5ecbe36c7 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -566,9 +566,9 @@ export default class LoginComponent extends React.Component { this[PasswordLogin.LOGIN_FIELD_EMAIL] = field} />; case PasswordLogin.LOGIN_FIELD_MXID: - classes.error = this.props.loginIncorrect && !this.state.username; + classes.error = this.props.loginIncorrect && !this.props.username; return ; case PasswordLogin.LOGIN_FIELD_PHONE: { const CountryDropdown = sdk.getComponent('views.auth.CountryDropdown'); - classes.error = this.props.loginIncorrect && !this.state.phoneNumber; + classes.error = this.props.loginIncorrect && !this.props.phoneNumber; const phoneCountry =