Fix repeated attempt to transfer ownership.

Fixes #8570.
This commit is contained in:
John Preston 2021-10-01 14:12:15 +04:00
parent c2212c719e
commit 85760ea92c

View file

@ -453,7 +453,14 @@ void EditAdminBox::transferOwnership() {
)).fail([=](const MTP::Error &error) { )).fail([=](const MTP::Error &error) {
_checkTransferRequestId = 0; _checkTransferRequestId = 0;
if (!handleTransferPasswordError(error)) { if (!handleTransferPasswordError(error)) {
getDelegate()->show(Box<ConfirmBox>( const auto box = std::make_shared<QPointer<ConfirmBox>>();
const auto callback = crl::guard(this, [=] {
transferOwnershipChecked();
if (*box) {
(*box)->closeBox();
}
});
*box = getDelegate()->show(Box<ConfirmBox>(
tr::lng_rights_transfer_about( tr::lng_rights_transfer_about(
tr::now, tr::now,
lt_group, lt_group,
@ -462,7 +469,7 @@ void EditAdminBox::transferOwnership() {
Ui::Text::Bold(user()->shortName()), Ui::Text::Bold(user()->shortName()),
Ui::Text::RichLangValue), Ui::Text::RichLangValue),
tr::lng_rights_transfer_sure(tr::now), tr::lng_rights_transfer_sure(tr::now),
crl::guard(this, [=] { transferOwnershipChecked(); }))); callback));
} }
}).send(); }).send();
} }