Fix error state for Commerce passphrase TextInputs

This commit is contained in:
Zach Fox 2017-12-20 13:46:02 -08:00
parent 08edc52932
commit e02e6790fe
2 changed files with 6 additions and 0 deletions

View file

@ -50,9 +50,11 @@ Item {
submitPassphraseInputButton.enabled = true; submitPassphraseInputButton.enabled = true;
if (!isAuthenticated) { if (!isAuthenticated) {
errorText.text = "Authentication failed - please try again."; errorText.text = "Authentication failed - please try again.";
passphraseField.error = true;
UserActivityLogger.commercePassphraseAuthenticationStatus("auth failure"); UserActivityLogger.commercePassphraseAuthenticationStatus("auth failure");
} else { } else {
sendSignalToParent({method: 'authSuccess'}); sendSignalToParent({method: 'authSuccess'});
passphraseField.error = false;
UserActivityLogger.commercePassphraseAuthenticationStatus("auth success"); UserActivityLogger.commercePassphraseAuthenticationStatus("auth success");
} }
} }
@ -72,6 +74,7 @@ Item {
// TODO: Fix this unlikely bug // TODO: Fix this unlikely bug
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
passphraseField.error = false;
passphraseField.focus = true; passphraseField.focus = true;
sendSignalToParent({method: 'disableHmdPreview'}); sendSignalToParent({method: 'disableHmdPreview'});
} else { } else {

View file

@ -54,6 +54,9 @@ Item {
// TODO: Fix this unlikely bug // TODO: Fix this unlikely bug
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
passphraseField.error = false;
passphraseFieldAgain.error = false;
currentPassphraseField.error = false;
if (root.shouldImmediatelyFocus) { if (root.shouldImmediatelyFocus) {
focusFirstTextField(); focusFirstTextField();
} }