From ca7f4ffed9e951f376eb0d24e8a980332a173a9c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 23 Feb 2022 07:43:33 +0300 Subject: [PATCH] Removed Ui::show from Settings::SessionsContent. --- Telegram/SourceFiles/boxes/sessions_box.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/boxes/sessions_box.cpp b/Telegram/SourceFiles/boxes/sessions_box.cpp index cdeecc99b..84af1d756 100644 --- a/Telegram/SourceFiles/boxes/sessions_box.cpp +++ b/Telegram/SourceFiles/boxes/sessions_box.cpp @@ -823,13 +823,13 @@ void SessionsContent::terminate(Fn terminateRequest, QString message) { } terminateRequest(); }); - _terminateBox = Ui::show( - Box( - message, - tr::lng_settings_reset_button(tr::now), - st::attentionBoxButton, - callback), - Ui::LayerOption::KeepOther); + auto box = Box( + message, + tr::lng_settings_reset_button(tr::now), + st::attentionBoxButton, + callback); + _terminateBox = Ui::MakeWeak(box.data()); + _controller->show(std::move(box), Ui::LayerOption::KeepOther); } void SessionsContent::terminateOne(uint64 hash) { @@ -911,7 +911,7 @@ void SessionsContent::Inner::setupContent() { rename->moveToRight(x, y, outer.width()); }, rename->lifetime()); rename->setClickedCallback([=] { - Ui::show(Box(RenameBox), Ui::LayerOption::KeepOther); + _controller->show(Box(RenameBox), Ui::LayerOption::KeepOther); }); const auto session = &_controller->session();