From d0614efd65ff378829c4247b4ae54c9910f28298 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 28 Jun 2018 18:29:51 +0100 Subject: [PATCH] Prevent displaying two export suggest boxes. --- .../export/view/export_view_panel_controller.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp index ddf353dc8b..56edd0c034 100644 --- a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp +++ b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp @@ -46,16 +46,7 @@ SuggestBox::SuggestBox(QWidget*) { void SuggestBox::prepare() { setTitle(langFactory(lng_export_suggest_title)); - const auto clear = [=] { - if (_cleared) { - return; - } - _cleared = true; - ClearSuggestStart(); - }; - addButton(langFactory(lng_box_ok), [=] { - clear(); closeBox(); Auth().data().startExport(); }); @@ -79,8 +70,6 @@ void SuggestBox::prepare() { ) | rpl::start_with_next([=](int height) { setDimensions(st::boxWidth, height + st::boxPadding.bottom()); }, content->lifetime()); - - boxClosing() | rpl::start_with_next(clear, lifetime()); } Environment PrepareEnvironment() { @@ -102,6 +91,7 @@ Environment PrepareEnvironment() { } // namespace void SuggestStart() { + ClearSuggestStart(); Ui::show(Box(), LayerOption::KeepOther); }