From 85760ea92c206069d56daf02d9377f5878ba6a77 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 1 Oct 2021 14:12:15 +0400 Subject: [PATCH] Fix repeated attempt to transfer ownership. Fixes #8570. --- .../SourceFiles/boxes/peers/edit_participant_box.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp index bf0d5d827..29badb28f 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp @@ -453,7 +453,14 @@ void EditAdminBox::transferOwnership() { )).fail([=](const MTP::Error &error) { _checkTransferRequestId = 0; if (!handleTransferPasswordError(error)) { - getDelegate()->show(Box( + const auto box = std::make_shared>(); + const auto callback = crl::guard(this, [=] { + transferOwnershipChecked(); + if (*box) { + (*box)->closeBox(); + } + }); + *box = getDelegate()->show(Box( tr::lng_rights_transfer_about( tr::now, lt_group, @@ -462,7 +469,7 @@ void EditAdminBox::transferOwnership() { Ui::Text::Bold(user()->shortName()), Ui::Text::RichLangValue), tr::lng_rights_transfer_sure(tr::now), - crl::guard(this, [=] { transferOwnershipChecked(); }))); + callback)); } }).send(); }