Prevent displaying two export suggest boxes.
This commit is contained in:
parent
b0baf75fdd
commit
d0614efd65
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue