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() {
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<SuggestBox>(), LayerOption::KeepOther);
}