mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-30 23:38:25 +00:00
select wrong passcode / password when showing error message
This commit is contained in:
parent
e5c82fad21
commit
3cf4c7f2fc
@ -356,6 +356,7 @@ void PasscodeBox::onSave(bool force) {
|
||||
return;
|
||||
}
|
||||
if (pwd != conf) {
|
||||
_reenterPasscode.selectAll();
|
||||
_reenterPasscode.setFocus();
|
||||
_reenterPasscode.showError();
|
||||
if (!conf.isEmpty()) {
|
||||
@ -603,6 +604,8 @@ bool RecoverBox::codeSubmitFail(const RPCError &error) {
|
||||
} else if (err == "CODE_INVALID") {
|
||||
_error = lang(lng_signin_wrong_code);
|
||||
update();
|
||||
_recoverCode.selectAll();
|
||||
_recoverCode.setFocus();
|
||||
_recoverCode.showError();
|
||||
return true;
|
||||
} else if (mtpIsFlood(error)) {
|
||||
|
@ -252,7 +252,7 @@ bool IntroCode::codeSubmitFail(const RPCError &error) {
|
||||
return true;
|
||||
} else if (err == "PHONE_CODE_EMPTY" || err == "PHONE_CODE_INVALID") {
|
||||
showError(lang(lng_bad_code));
|
||||
code.setFocus();
|
||||
code.notaBene();
|
||||
return true;
|
||||
} else if (err == "PHONE_NUMBER_UNOCCUPIED") { // success, need to signUp
|
||||
intro()->setCode(sentCode);
|
||||
|
@ -199,6 +199,7 @@ bool IntroPwdCheck::pwdSubmitFail(const RPCError &error) {
|
||||
const QString &err = error.type();
|
||||
if (err == "PASSWORD_HASH_INVALID") {
|
||||
showError(lang(lng_signin_bad_password));
|
||||
_pwdField.selectAll();
|
||||
_pwdField.notaBene();
|
||||
return true;
|
||||
} else if (err == "PASSWORD_EMPTY") {
|
||||
@ -235,6 +236,7 @@ bool IntroPwdCheck::codeSubmitFail(const RPCError &error) {
|
||||
return true;
|
||||
} else if (err == "CODE_INVALID") {
|
||||
showError(lang(lng_signin_wrong_code));
|
||||
_codeField.selectAll();
|
||||
_codeField.notaBene();
|
||||
return true;
|
||||
} else if (mtpIsFlood(error)) {
|
||||
|
@ -55,13 +55,11 @@ void PasscodeWidget::onParentResize(const QSize &newSize) {
|
||||
|
||||
void PasscodeWidget::onSubmit() {
|
||||
if (_passcode.text().isEmpty()) {
|
||||
_passcode.setFocus();
|
||||
_passcode.notaBene();
|
||||
return;
|
||||
}
|
||||
if (!passcodeCanTry()) {
|
||||
_error = lang(lng_flood_error);
|
||||
_passcode.setFocus();
|
||||
_passcode.notaBene();
|
||||
update();
|
||||
return;
|
||||
@ -100,7 +98,6 @@ void PasscodeWidget::onSubmit() {
|
||||
void PasscodeWidget::onError() {
|
||||
_error = lang(lng_passcode_wrong);
|
||||
_passcode.selectAll();
|
||||
_passcode.setFocus();
|
||||
_passcode.notaBene();
|
||||
update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user