Handle flood errors in birthday changes.
This commit is contained in:
parent
0d740c21a2
commit
ab74ed0fa7
|
@ -697,8 +697,11 @@ bool ShowEditBirthday(
|
||||||
)).done(crl::guard(controller, [=] {
|
)).done(crl::guard(controller, [=] {
|
||||||
controller->showToast(tr::lng_settings_birthday_saved(tr::now));
|
controller->showToast(tr::lng_settings_birthday_saved(tr::now));
|
||||||
})).fail(crl::guard(controller, [=](const MTP::Error &error) {
|
})).fail(crl::guard(controller, [=](const MTP::Error &error) {
|
||||||
controller->showToast(u"Error: "_q + error.type());
|
const auto type = error.type();
|
||||||
})).send();
|
controller->showToast(type.startsWith(u"FLOOD_WAIT_"_q)
|
||||||
|
? tr::lng_flood_error(tr::now)
|
||||||
|
: (u"Error: "_q + error.type()));
|
||||||
|
})).handleFloodErrors().send();
|
||||||
};
|
};
|
||||||
controller->show(Box(
|
controller->show(Box(
|
||||||
Ui::EditBirthdayBox,
|
Ui::EditBirthdayBox,
|
||||||
|
|
Loading…
Reference in New Issue