feat(auth): add error text feedback
This commit is contained in:
parent
c947a84477
commit
deb590ccb3
3 changed files with 16 additions and 3 deletions
|
|
@ -678,7 +678,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
|
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
errorText: {fileID: 0}
|
errorText: {fileID: 562590035}
|
||||||
--- !u!1 &330585543
|
--- !u!1 &330585543
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1609,7 +1609,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
|
m_Script: {fileID: 11500000, guid: cc52e32da9f14d4596cc527b7496815a, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
errorText: {fileID: 0}
|
errorText: {fileID: 1082297275}
|
||||||
--- !u!1 &555582722
|
--- !u!1 &555582722
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,19 @@ namespace _Hub.Scripts.UI
|
||||||
(_maxUsernameLength >= _username.Length && _maxPasswordLength >= _password.Length) &&
|
(_maxUsernameLength >= _username.Length && _maxPasswordLength >= _password.Length) &&
|
||||||
usernameRegex.Success);
|
usernameRegex.Success);
|
||||||
EnableLoginButton(interactable);
|
EnableLoginButton(interactable);
|
||||||
|
|
||||||
|
//Username
|
||||||
|
if (_username != null)
|
||||||
|
{
|
||||||
|
var usernameTooLong = _username.Length > _maxUsernameLength;
|
||||||
|
usernameInputField.Error(usernameTooLong);
|
||||||
|
}
|
||||||
|
//Password
|
||||||
|
if (_password != null )
|
||||||
|
{
|
||||||
|
var passwordTooLong = _password.Length > _maxPasswordLength;
|
||||||
|
passwordInputField.Error(passwordTooLong);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableLoginButton(bool interactable)
|
private void EnableLoginButton(bool interactable)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace _Network.Auth
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errorText.gameObject.SetActive(true);
|
errorText.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue