Fixed API support for different boosts lists.

This commit is contained in:
23rd 2023-11-07 02:09:37 +03:00
parent 3dd415d0c2
commit c9cabfb084
2 changed files with 3 additions and 5 deletions

View file

@ -540,7 +540,6 @@ rpl::producer<rpl::no_value, QString> Boosts::request() {
_boostStatus.firstSliceGifts = std::move(s); _boostStatus.firstSliceGifts = std::move(s);
consumer.put_done(); consumer.put_done();
}); });
consumer.put_done();
}); });
}).fail([=](const MTP::Error &error) { }).fail([=](const MTP::Error &error) {
consumer.put_error_copy(error.type()); consumer.put_error_copy(error.type());

View file

@ -365,10 +365,9 @@ void InnerWidget::fill() {
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>( object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
inner, inner,
object_ptr<Ui::VerticalLayout>(inner))); object_ptr<Ui::VerticalLayout>(inner)));
boostsWrap->toggle(hasOneTab ? true : hasBoosts, anim::type::instant);
giftsWrap->toggle(hasOneTab ? false : hasGifts, anim::type::instant);
slider->entity()->sectionActivated( rpl::single(hasGifts ? 1 : 0) | rpl::then(
slider->entity()->sectionActivated()
) | rpl::start_with_next([=](int index) { ) | rpl::start_with_next([=](int index) {
boostsWrap->toggle(!index, anim::type::instant); boostsWrap->toggle(!index, anim::type::instant);
giftsWrap->toggle(index, anim::type::instant); giftsWrap->toggle(index, anim::type::instant);
@ -403,7 +402,7 @@ void InnerWidget::fill() {
FillGetBoostsButton(inner, _controller, _show, _peer); FillGetBoostsButton(inner, _controller, _show, _peer);
resizeToWidth(width()); resizeToWidth(width());
crl::on_main([=]{ fakeShowed->fire({}); }); crl::on_main(this, [=]{ fakeShowed->fire({}); });
} }
void InnerWidget::saveState(not_null<Memento*> memento) { void InnerWidget::saveState(not_null<Memento*> memento) {