mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added initial list of prepaid giveaway to boosts info.
This commit is contained in:
parent
3522d9c62e
commit
c9cad4186b
6 changed files with 166 additions and 34 deletions
|
@ -4346,6 +4346,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_boosts_list_tab_gifts#one" = "{count} Gifts";
|
"lng_boosts_list_tab_gifts#one" = "{count} Gifts";
|
||||||
"lng_boosts_list_tab_gifts#other" = "{count} Gifts";
|
"lng_boosts_list_tab_gifts#other" = "{count} Gifts";
|
||||||
|
|
||||||
|
"lng_boosts_prepaid_giveaway_title" = "Prepaid giveaways";
|
||||||
|
"lng_boosts_prepaid_giveaway_single" = "Prepaid giveaway";
|
||||||
|
"lng_boosts_prepaid_giveaway_quantity#one" = "{count} Telegram Premium";
|
||||||
|
"lng_boosts_prepaid_giveaway_quantity#other" = "{count} Telegram Premium";
|
||||||
|
"lng_boosts_prepaid_giveaway_moths#one" = "{count}-month subscriptions";
|
||||||
|
"lng_boosts_prepaid_giveaway_moths#other" = "{count}-month subscriptions";
|
||||||
|
"lng_boosts_prepaid_giveaway_status#one" = "{count} subscription {duration}";
|
||||||
|
"lng_boosts_prepaid_giveaway_status#other" = "{count} subscriptions {duration}";
|
||||||
|
|
||||||
// Wnd specific
|
// Wnd specific
|
||||||
|
|
||||||
"lng_wnd_choose_program_menu" = "Choose Default Program...";
|
"lng_wnd_choose_program_menu" = "Choose Default Program...";
|
||||||
|
|
|
@ -230,7 +230,8 @@ void CreateGiveawayBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Info::Controller*> controller,
|
not_null<Info::Controller*> controller,
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
Fn<void()> reloadOnDone) {
|
Fn<void()> reloadOnDone,
|
||||||
|
std::optional<Data::BoostPrepaidGiveaway> prepaid) {
|
||||||
box->setWidth(st::boxWideWidth);
|
box->setWidth(st::boxWideWidth);
|
||||||
|
|
||||||
const auto weakWindow = base::make_weak(controller->parentController());
|
const auto weakWindow = base::make_weak(controller->parentController());
|
||||||
|
@ -298,7 +299,23 @@ void CreateGiveawayBox(
|
||||||
object_ptr<Ui::VerticalLayout>(box)));
|
object_ptr<Ui::VerticalLayout>(box)));
|
||||||
contentWrap->toggle(false, anim::type::instant);
|
contentWrap->toggle(false, anim::type::instant);
|
||||||
|
|
||||||
{
|
if (prepaid) {
|
||||||
|
contentWrap->entity()->add(
|
||||||
|
object_ptr<Giveaway::GiveawayTypeRow>(
|
||||||
|
box,
|
||||||
|
GiveawayType::Prepaid,
|
||||||
|
prepaid->id,
|
||||||
|
tr::lng_boosts_prepaid_giveaway_single(),
|
||||||
|
tr::lng_boosts_prepaid_giveaway_status(
|
||||||
|
lt_count,
|
||||||
|
rpl::single(prepaid->quantity) | tr::to_count(),
|
||||||
|
lt_duration,
|
||||||
|
tr::lng_premium_gift_duration_months(
|
||||||
|
lt_count,
|
||||||
|
rpl::single(prepaid->months) | tr::to_count())))
|
||||||
|
)->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
}
|
||||||
|
if (!prepaid) {
|
||||||
const auto row = contentWrap->entity()->add(
|
const auto row = contentWrap->entity()->add(
|
||||||
object_ptr<Giveaway::GiveawayTypeRow>(
|
object_ptr<Giveaway::GiveawayTypeRow>(
|
||||||
box,
|
box,
|
||||||
|
@ -309,7 +326,7 @@ void CreateGiveawayBox(
|
||||||
state->typeValue.force_assign(GiveawayType::Random);
|
state->typeValue.force_assign(GiveawayType::Random);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
{
|
if (!prepaid) {
|
||||||
const auto row = contentWrap->entity()->add(
|
const auto row = contentWrap->entity()->add(
|
||||||
object_ptr<Giveaway::GiveawayTypeRow>(
|
object_ptr<Giveaway::GiveawayTypeRow>(
|
||||||
box,
|
box,
|
||||||
|
@ -387,6 +404,10 @@ void CreateGiveawayBox(
|
||||||
object_ptr<Ui::VerticalLayout>(randomWrap));
|
object_ptr<Ui::VerticalLayout>(randomWrap));
|
||||||
const auto fillSliderContainer = [=] {
|
const auto fillSliderContainer = [=] {
|
||||||
const auto availablePresets = state->apiOptions.availablePresets();
|
const auto availablePresets = state->apiOptions.availablePresets();
|
||||||
|
if (prepaid) {
|
||||||
|
state->sliderValue = prepaid->quantity;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (availablePresets.empty()) {
|
if (availablePresets.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -675,6 +696,9 @@ void CreateGiveawayBox(
|
||||||
const auto listOptions = contentWrap->entity()->add(
|
const auto listOptions = contentWrap->entity()->add(
|
||||||
object_ptr<Ui::VerticalLayout>(box));
|
object_ptr<Ui::VerticalLayout>(box));
|
||||||
const auto rebuildListOptions = [=](int amountUsers) {
|
const auto rebuildListOptions = [=](int amountUsers) {
|
||||||
|
if (prepaid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
while (listOptions->count()) {
|
while (listOptions->count()) {
|
||||||
delete listOptions->widgetAt(0);
|
delete listOptions->widgetAt(0);
|
||||||
}
|
}
|
||||||
|
@ -714,8 +738,7 @@ void CreateGiveawayBox(
|
||||||
|
|
||||||
box->verticalLayout()->resizeToWidth(box->width());
|
box->verticalLayout()->resizeToWidth(box->width());
|
||||||
};
|
};
|
||||||
{
|
if (!prepaid) {
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
state->sliderValue.value(),
|
state->sliderValue.value(),
|
||||||
state->typeValue.value()
|
state->typeValue.value()
|
||||||
|
@ -725,6 +748,8 @@ void CreateGiveawayBox(
|
||||||
? state->selectedToAward.size()
|
? state->selectedToAward.size()
|
||||||
: users);
|
: users);
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
} else {
|
||||||
|
typeGroup->setValue(GiveawayType::Random);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
using namespace Info::Statistics;
|
using namespace Info::Statistics;
|
||||||
|
@ -783,7 +808,10 @@ void CreateGiveawayBox(
|
||||||
isSpecific
|
isSpecific
|
||||||
? state->selectedToAward.size()
|
? state->selectedToAward.size()
|
||||||
: state->sliderValue.current(),
|
: state->sliderValue.current(),
|
||||||
durationGroup->value());
|
prepaid
|
||||||
|
? prepaid->months
|
||||||
|
: state->apiOptions.monthsFromPreset(
|
||||||
|
durationGroup->value()));
|
||||||
if (isSpecific) {
|
if (isSpecific) {
|
||||||
if (state->selectedToAward.empty()) {
|
if (state->selectedToAward.empty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -855,7 +883,21 @@ void CreateGiveawayBox(
|
||||||
state->confirmButtonBusy = false;
|
state->confirmButtonBusy = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Payments::CheckoutProcess::Start(std::move(invoice), done);
|
if (prepaid) {
|
||||||
|
state->apiOptions.applyPrepaid(
|
||||||
|
invoice,
|
||||||
|
prepaid->id
|
||||||
|
) | rpl::start_with_error_done([=](const QString &error) {
|
||||||
|
if (const auto window = weakWindow.get()) {
|
||||||
|
window->uiShow()->showToast(error);
|
||||||
|
done(Payments::CheckoutResult::Cancelled);
|
||||||
|
}
|
||||||
|
}, [=] {
|
||||||
|
done(Payments::CheckoutResult::Paid);
|
||||||
|
}, box->lifetime());
|
||||||
|
} else {
|
||||||
|
Payments::CheckoutProcess::Start(std::move(invoice), done);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
box->addButton(std::move(button));
|
box->addButton(std::move(button));
|
||||||
}
|
}
|
||||||
|
@ -867,9 +909,7 @@ void CreateGiveawayBox(
|
||||||
if (!loading->toggled()) {
|
if (!loading->toggled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state->lifetimeApi = state->apiOptions.request(
|
const auto done = [=] {
|
||||||
) | rpl::start_with_error_done([=](const QString &error) {
|
|
||||||
}, [=] {
|
|
||||||
state->lifetimeApi.destroy();
|
state->lifetimeApi.destroy();
|
||||||
loading->toggle(false, anim::type::instant);
|
loading->toggle(false, anim::type::instant);
|
||||||
state->confirmButtonBusy = false;
|
state->confirmButtonBusy = false;
|
||||||
|
@ -877,6 +917,14 @@ void CreateGiveawayBox(
|
||||||
rebuildListOptions(1);
|
rebuildListOptions(1);
|
||||||
contentWrap->toggle(true, anim::type::instant);
|
contentWrap->toggle(true, anim::type::instant);
|
||||||
contentWrap->resizeToWidth(box->width());
|
contentWrap->resizeToWidth(box->width());
|
||||||
});
|
};
|
||||||
|
if (prepaid) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
state->lifetimeApi = state->apiOptions.request(
|
||||||
|
) | rpl::start_with_error_done([=](const QString &error) {
|
||||||
|
box->uiShow()->showToast(error);
|
||||||
|
box->closeBox();
|
||||||
|
}, done);
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
class PeerData;
|
class PeerData;
|
||||||
|
|
||||||
|
namespace Data {
|
||||||
|
struct BoostPrepaidGiveaway;
|
||||||
|
} // namespace Data
|
||||||
|
|
||||||
namespace Info {
|
namespace Info {
|
||||||
class Controller;
|
class Controller;
|
||||||
} // namespace Info
|
} // namespace Info
|
||||||
|
@ -21,4 +25,5 @@ void CreateGiveawayBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Info::Controller*> controller,
|
not_null<Info::Controller*> controller,
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
Fn<void()> reloadOnDone);
|
Fn<void()> reloadOnDone,
|
||||||
|
std::optional<Data::BoostPrepaidGiveaway> prepaidGiveaway);
|
||||||
|
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_giveaway.h"
|
#include "styles/style_giveaway.h"
|
||||||
|
#include "styles/style_statistics.h"
|
||||||
|
|
||||||
namespace Giveaway {
|
namespace Giveaway {
|
||||||
|
|
||||||
|
@ -24,31 +25,46 @@ GiveawayTypeRow::GiveawayTypeRow(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
Type type,
|
Type type,
|
||||||
rpl::producer<QString> subtitle)
|
rpl::producer<QString> subtitle)
|
||||||
|
: GiveawayTypeRow(
|
||||||
|
parent,
|
||||||
|
type,
|
||||||
|
(type == Type::SpecificUsers) ? kColorIndexSpecific : kColorIndexRandom,
|
||||||
|
(type == Type::SpecificUsers)
|
||||||
|
? tr::lng_giveaway_award_option()
|
||||||
|
: (type == Type::Random)
|
||||||
|
? tr::lng_giveaway_create_option()
|
||||||
|
: (type == Type::AllMembers)
|
||||||
|
? tr::lng_giveaway_users_all()
|
||||||
|
: tr::lng_giveaway_users_new(),
|
||||||
|
std::move(subtitle)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
GiveawayTypeRow::GiveawayTypeRow(
|
||||||
|
not_null<Ui::RpWidget*> parent,
|
||||||
|
Type type,
|
||||||
|
int colorIndex,
|
||||||
|
rpl::producer<QString> title,
|
||||||
|
rpl::producer<QString> subtitle)
|
||||||
: RippleButton(parent, st::defaultRippleAnimation)
|
: RippleButton(parent, st::defaultRippleAnimation)
|
||||||
, _type(type)
|
, _type(type)
|
||||||
, _st((_type == Type::SpecificUsers || _type == Type::Random)
|
, _st((_type == Type::SpecificUsers || _type == Type::Random)
|
||||||
? st::giveawayTypeListItem
|
? st::giveawayTypeListItem
|
||||||
|
: (_type == Type::Prepaid)
|
||||||
|
? st::boostsListBox.item
|
||||||
: st::giveawayGiftCodeMembersPeerList.item)
|
: st::giveawayGiftCodeMembersPeerList.item)
|
||||||
, _userpic(
|
, _userpic(
|
||||||
Ui::EmptyUserpic::UserpicColor((_type == Type::SpecificUsers)
|
Ui::EmptyUserpic::UserpicColor(Ui::EmptyUserpic::ColorIndex(colorIndex)),
|
||||||
? kColorIndexSpecific
|
QString()) {
|
||||||
: kColorIndexRandom),
|
|
||||||
QString())
|
|
||||||
, _name(
|
|
||||||
_st.nameStyle,
|
|
||||||
(type == Type::SpecificUsers)
|
|
||||||
? tr::lng_giveaway_award_option(tr::now)
|
|
||||||
: (type == Type::Random)
|
|
||||||
? tr::lng_giveaway_create_option(tr::now)
|
|
||||||
: (type == Type::AllMembers)
|
|
||||||
? tr::lng_giveaway_users_all(tr::now)
|
|
||||||
: tr::lng_giveaway_users_new(tr::now),
|
|
||||||
Ui::NameTextOptions()) {
|
|
||||||
std::move(
|
std::move(
|
||||||
subtitle
|
subtitle
|
||||||
) | rpl::start_with_next([=] (const QString &s) {
|
) | rpl::start_with_next([=] (const QString &s) {
|
||||||
_status.setText(st::defaultTextStyle, s, Ui::NameTextOptions());
|
_status.setText(st::defaultTextStyle, s, Ui::NameTextOptions());
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
std::move(
|
||||||
|
title
|
||||||
|
) | rpl::start_with_next([=] (const QString &s) {
|
||||||
|
_name.setText(_st.nameStyle, s, Ui::NameTextOptions());
|
||||||
|
}, lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
int GiveawayTypeRow::resizeGetHeight(int) {
|
int GiveawayTypeRow::resizeGetHeight(int) {
|
||||||
|
@ -62,7 +78,10 @@ void GiveawayTypeRow::paintEvent(QPaintEvent *e) {
|
||||||
const auto skipRight = _st.photoPosition.x();
|
const auto skipRight = _st.photoPosition.x();
|
||||||
const auto outerWidth = width();
|
const auto outerWidth = width();
|
||||||
const auto isSpecific = (_type == Type::SpecificUsers);
|
const auto isSpecific = (_type == Type::SpecificUsers);
|
||||||
const auto hasUserpic = (_type == Type::Random) || isSpecific;
|
const auto isPrepaid = (_type == Type::Prepaid);
|
||||||
|
const auto hasUserpic = (_type == Type::Random)
|
||||||
|
|| isSpecific
|
||||||
|
|| isPrepaid;
|
||||||
|
|
||||||
if (paintOver) {
|
if (paintOver) {
|
||||||
p.fillRect(e->rect(), _st.button.textBgOver);
|
p.fillRect(e->rect(), _st.button.textBgOver);
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
|
|
||||||
AllMembers,
|
AllMembers,
|
||||||
OnlyNewMembers,
|
OnlyNewMembers,
|
||||||
|
|
||||||
|
Prepaid,
|
||||||
};
|
};
|
||||||
|
|
||||||
GiveawayTypeRow(
|
GiveawayTypeRow(
|
||||||
|
@ -32,6 +34,13 @@ public:
|
||||||
Type type,
|
Type type,
|
||||||
rpl::producer<QString> subtitle);
|
rpl::producer<QString> subtitle);
|
||||||
|
|
||||||
|
GiveawayTypeRow(
|
||||||
|
not_null<Ui::RpWidget*> parent,
|
||||||
|
Type type,
|
||||||
|
int colorIndex,
|
||||||
|
rpl::producer<QString> title,
|
||||||
|
rpl::producer<QString> subtitle);
|
||||||
|
|
||||||
void addRadio(std::shared_ptr<Ui::RadioenumGroup<Type>> typeGroup);
|
void addRadio(std::shared_ptr<Ui::RadioenumGroup<Type>> typeGroup);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
#include "info/boosts/create_giveaway_box.h"
|
#include "info/boosts/create_giveaway_box.h"
|
||||||
|
#include "info/boosts/giveaway/giveaway_type_row.h"
|
||||||
#include "info/boosts/info_boosts_widget.h"
|
#include "info/boosts/info_boosts_widget.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
#include "info/profile/info_profile_icon.h"
|
#include "info/profile/info_profile_icon.h"
|
||||||
|
@ -25,11 +26,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "statistics/widgets/chart_header_widget.h"
|
#include "statistics/widgets/chart_header_widget.h"
|
||||||
#include "ui/boxes/boost_box.h"
|
#include "ui/boxes/boost_box.h"
|
||||||
#include "ui/controls/invite_link_label.h"
|
#include "ui/controls/invite_link_label.h"
|
||||||
|
#include "ui/effects/ripple_animation.h"
|
||||||
|
#include "ui/empty_userpic.h"
|
||||||
|
#include "ui/painter.h"
|
||||||
#include "ui/rect.h"
|
#include "ui/rect.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/widgets/discrete_sliders.h"
|
#include "ui/widgets/discrete_sliders.h"
|
||||||
#include "ui/widgets/labels.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
|
#include "styles/style_giveaway.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
#include "styles/style_statistics.h"
|
#include "styles/style_statistics.h"
|
||||||
|
|
||||||
|
@ -230,7 +235,12 @@ void FillGetBoostsButton(
|
||||||
tr::lng_boosts_get_boosts(),
|
tr::lng_boosts_get_boosts(),
|
||||||
st));
|
st));
|
||||||
button->setClickedCallback([=] {
|
button->setClickedCallback([=] {
|
||||||
show->showBox(Box(CreateGiveawayBox, controller, peer, reloadOnDone));
|
show->showBox(Box(
|
||||||
|
CreateGiveawayBox,
|
||||||
|
controller,
|
||||||
|
peer,
|
||||||
|
reloadOnDone,
|
||||||
|
std::nullopt));
|
||||||
});
|
});
|
||||||
Ui::CreateChild<Info::Profile::FloatingIcon>(
|
Ui::CreateChild<Info::Profile::FloatingIcon>(
|
||||||
button,
|
button,
|
||||||
|
@ -280,6 +290,13 @@ void InnerWidget::fill() {
|
||||||
const auto &status = _state;
|
const auto &status = _state;
|
||||||
const auto inner = this;
|
const auto inner = this;
|
||||||
|
|
||||||
|
const auto reloadOnDone = crl::guard(this, [=] {
|
||||||
|
while (Ui::VerticalLayout::count()) {
|
||||||
|
delete Ui::VerticalLayout::widgetAt(0);
|
||||||
|
}
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
auto dividerContent = object_ptr<Ui::VerticalLayout>(inner);
|
auto dividerContent = object_ptr<Ui::VerticalLayout>(inner);
|
||||||
Ui::FillBoostLimit(
|
Ui::FillBoostLimit(
|
||||||
|
@ -308,6 +325,37 @@ void InnerWidget::fill() {
|
||||||
::Settings::AddDivider(inner);
|
::Settings::AddDivider(inner);
|
||||||
::Settings::AddSkip(inner);
|
::Settings::AddSkip(inner);
|
||||||
|
|
||||||
|
if (!status.prepaidGiveaway.empty()) {
|
||||||
|
::Settings::AddSkip(inner);
|
||||||
|
AddHeader(inner, tr::lng_boosts_prepaid_giveaway_title);
|
||||||
|
::Settings::AddSkip(inner);
|
||||||
|
for (const auto &g : status.prepaidGiveaway) {
|
||||||
|
using namespace Giveaway;
|
||||||
|
const auto button = inner->add(object_ptr<GiveawayTypeRow>(
|
||||||
|
inner,
|
||||||
|
GiveawayTypeRow::Type::Prepaid,
|
||||||
|
g.id,
|
||||||
|
tr::lng_boosts_prepaid_giveaway_quantity(
|
||||||
|
lt_count,
|
||||||
|
rpl::single(g.quantity) | tr::to_count()),
|
||||||
|
tr::lng_boosts_prepaid_giveaway_moths(
|
||||||
|
lt_count,
|
||||||
|
rpl::single(g.months) | tr::to_count())));
|
||||||
|
button->setClickedCallback([=] {
|
||||||
|
_controller->uiShow()->showBox(Box(
|
||||||
|
CreateGiveawayBox,
|
||||||
|
_controller,
|
||||||
|
_peer,
|
||||||
|
reloadOnDone,
|
||||||
|
g));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
::Settings::AddSkip(inner);
|
||||||
|
::Settings::AddDivider(inner);
|
||||||
|
::Settings::AddSkip(inner);
|
||||||
|
}
|
||||||
|
|
||||||
const auto hasBoosts = (status.firstSliceBoosts.multipliedTotal > 0);
|
const auto hasBoosts = (status.firstSliceBoosts.multipliedTotal > 0);
|
||||||
const auto hasGifts = (status.firstSliceGifts.multipliedTotal > 0);
|
const auto hasGifts = (status.firstSliceGifts.multipliedTotal > 0);
|
||||||
if (hasBoosts || hasGifts) {
|
if (hasBoosts || hasGifts) {
|
||||||
|
@ -429,12 +477,6 @@ void InnerWidget::fill() {
|
||||||
::Settings::AddSkip(inner);
|
::Settings::AddSkip(inner);
|
||||||
::Settings::AddDividerText(inner, tr::lng_boosts_link_subtext());
|
::Settings::AddDividerText(inner, tr::lng_boosts_link_subtext());
|
||||||
|
|
||||||
const auto reloadOnDone = crl::guard(this, [=] {
|
|
||||||
while (Ui::VerticalLayout::count()) {
|
|
||||||
delete Ui::VerticalLayout::widgetAt(0);
|
|
||||||
}
|
|
||||||
load();
|
|
||||||
});
|
|
||||||
FillGetBoostsButton(inner, _controller, _show, _peer, reloadOnDone);
|
FillGetBoostsButton(inner, _controller, _show, _peer, reloadOnDone);
|
||||||
|
|
||||||
resizeToWidth(width());
|
resizeToWidth(width());
|
||||||
|
|
Loading…
Add table
Reference in a new issue