Fix possible premature export bar destruction.

This commit is contained in:
John Preston 2018-07-20 15:28:06 +03:00
parent 41977bf515
commit 06fc23fc59
1 changed files with 6 additions and 6 deletions

View File

@ -1559,12 +1559,6 @@ void MainWidget::createExportTopBar(Export::View::Content &&data) {
_exportTopBar.create(
this,
object_ptr<Export::View::TopBar>(this, std::move(data)));
rpl::merge(
_exportTopBar->heightValue() | rpl::map([] { return true; }),
_exportTopBar->shownValue()
) | rpl::start_with_next([=] {
exportTopBarHeightUpdated();
}, _exportTopBar->lifetime());
_exportTopBar->entity()->clicks(
) | rpl::start_with_next([=] {
if (_currentExportView) {
@ -1581,6 +1575,12 @@ void MainWidget::createExportTopBar(Export::View::Content &&data) {
_exportTopBarHeight = _contentScrollAddToY = _exportTopBar->contentHeight();
updateControlsGeometry();
}
rpl::merge(
_exportTopBar->heightValue() | rpl::map([] { return true; }),
_exportTopBar->shownValue()
) | rpl::start_with_next([=] {
exportTopBarHeightUpdated();
}, _exportTopBar->lifetime());
}
void MainWidget::destroyExportTopBar() {