mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-30 15:30:20 +00:00
Handle APP_VERSION_OUTDATED in saving/accepting.
This commit is contained in:
parent
6bf3006eb9
commit
dc114d62c5
Telegram/SourceFiles/passport
@ -707,7 +707,8 @@ std::vector<not_null<const Value*>> FormController::submitGetErrors() {
|
||||
[=] { cancel(); });
|
||||
}).fail([=](const RPCError &error) {
|
||||
_submitRequestId = 0;
|
||||
if (AcceptErrorRequiresRestart(error.type())) {
|
||||
if (handleAppUpdateError(error.type())) {
|
||||
} else if (AcceptErrorRequiresRestart(error.type())) {
|
||||
suggestRestart();
|
||||
} else {
|
||||
_view->show(Box<InformBox>(
|
||||
@ -1925,7 +1926,8 @@ void FormController::sendSaveRequest(
|
||||
}).fail([=](const RPCError &error) {
|
||||
value->saveRequestId = 0;
|
||||
const auto code = error.type();
|
||||
if (code == qstr("PHONE_VERIFICATION_NEEDED")) {
|
||||
if (handleAppUpdateError(code)) {
|
||||
} else if (code == qstr("PHONE_VERIFICATION_NEEDED")) {
|
||||
if (value->type == Value::Type::Phone) {
|
||||
startPhoneVerification(value);
|
||||
return;
|
||||
@ -2420,14 +2422,20 @@ bool FormController::parseForm(const MTPaccount_AuthorizationForm &result) {
|
||||
void FormController::formFail(const QString &error) {
|
||||
_savedPasswordValue = QByteArray();
|
||||
_serviceErrorText = error;
|
||||
if (error == "APP_VERSION_OUTDATED") {
|
||||
_view->showUpdateAppBox();
|
||||
} else {
|
||||
if (!handleAppUpdateError(error)) {
|
||||
_view->showCriticalError(
|
||||
lang(lng_passport_form_error) + "\n" + error);
|
||||
}
|
||||
}
|
||||
|
||||
bool FormController::handleAppUpdateError(const QString &error) {
|
||||
if (error == qstr("APP_VERSION_OUTDATED")) {
|
||||
_view->showUpdateAppBox();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void FormController::requestPassword() {
|
||||
if (_passwordRequestId) {
|
||||
return;
|
||||
|
@ -399,6 +399,7 @@ private:
|
||||
void fillDownloadedFile(
|
||||
File &destination,
|
||||
const std::vector<EditFile> &source) const;
|
||||
bool handleAppUpdateError(const QString &error);
|
||||
|
||||
void submitPassword(
|
||||
const Core::CloudPasswordResult &check,
|
||||
|
Loading…
Reference in New Issue
Block a user