diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index 45d4b1e99..6b9a0852c 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -192,20 +192,27 @@ void ShowAddParticipantsError( && channel && !channel->isMegagroup() && channel->canAddAdmins()) { - const auto makeAdmin = [=] { + const auto makeAdmin = [=](Fn close) { const auto user = forbidden.users.front(); const auto weak = std::make_shared>(); - const auto close = [=](auto&&...) { - if (*weak) { - (*weak)->closeBox(); + const auto done = [=](auto&&...) { + if (const auto strong = weak->data()) { + strong->uiShow()->showToast( + tr::lng_box_done(tr::now)); + strong->closeBox(); + } + }; + const auto fail = [=] { + if (const auto strong = weak->data()) { + strong->closeBox(); } }; const auto saveCallback = SaveAdminCallback( show, channel, user, - close, - close); + done, + fail); auto box = Box( channel, user, @@ -214,6 +221,7 @@ void ShowAddParticipantsError( box->setSaveCallback(saveCallback); *weak = box.data(); show->showBox(std::move(box)); + close(); }; show->showBox( Ui::MakeConfirmBox({