Prevent displaying two export suggest boxes.

This commit is contained in:
John Preston 2018-06-28 18:29:51 +01:00
parent b0baf75fdd
commit d0614efd65
1 changed files with 1 additions and 11 deletions

View File

@ -46,16 +46,7 @@ SuggestBox::SuggestBox(QWidget*) {
void SuggestBox::prepare() { void SuggestBox::prepare() {
setTitle(langFactory(lng_export_suggest_title)); setTitle(langFactory(lng_export_suggest_title));
const auto clear = [=] {
if (_cleared) {
return;
}
_cleared = true;
ClearSuggestStart();
};
addButton(langFactory(lng_box_ok), [=] { addButton(langFactory(lng_box_ok), [=] {
clear();
closeBox(); closeBox();
Auth().data().startExport(); Auth().data().startExport();
}); });
@ -79,8 +70,6 @@ void SuggestBox::prepare() {
) | rpl::start_with_next([=](int height) { ) | rpl::start_with_next([=](int height) {
setDimensions(st::boxWidth, height + st::boxPadding.bottom()); setDimensions(st::boxWidth, height + st::boxPadding.bottom());
}, content->lifetime()); }, content->lifetime());
boxClosing() | rpl::start_with_next(clear, lifetime());
} }
Environment PrepareEnvironment() { Environment PrepareEnvironment() {
@ -102,6 +91,7 @@ Environment PrepareEnvironment() {
} // namespace } // namespace
void SuggestStart() { void SuggestStart() {
ClearSuggestStart();
Ui::show(Box<SuggestBox>(), LayerOption::KeepOther); Ui::show(Box<SuggestBox>(), LayerOption::KeepOther);
} }