Fixed text of confirm box in giveaway box.

This commit is contained in:
23rd 2023-11-07 01:54:16 +03:00
parent 6eb7d68d49
commit 1cb762913c

View file

@ -237,6 +237,11 @@ void CreateGiveawayBox(
randomWrap->toggle(type == GiveawayType::Random, anim::type::instant);
}, randomWrap->lifetime());
randomWrap->toggleOn(
state->typeValue.value(
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
anim::type::instant);
const auto sliderContainer = randomWrap->entity()->add(
object_ptr<Ui::VerticalLayout>(randomWrap));
const auto fillSliderContainer = [=] {
@ -574,18 +579,19 @@ void CreateGiveawayBox(
box->setStyle(stButton);
auto button = object_ptr<Ui::RoundButton>(
box,
state->toAwardAmountChanged.events_starting_with(
rpl::empty_value()
) | rpl::map([=] {
return (typeGroup->value() == GiveawayType::SpecificUsers)
? tr::lng_giveaway_award()
: tr::lng_giveaway_start();
}) | rpl::flatten_latest(),
rpl::conditional(
state->typeValue.value(
) | rpl::map(rpl::mappers::_1 == GiveawayType::Random),
tr::lng_giveaway_start(),
tr::lng_giveaway_award()),
st::giveawayGiftCodeStartButton);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->resizeToWidth(box->width()
- stButton.buttonPadding.left()
- stButton.buttonPadding.right());
state->typeValue.value(
) | rpl::start_with_next([=, raw = button.data()] {
raw->resizeToWidth(box->width()
- stButton.buttonPadding.left()
- stButton.buttonPadding.right());
}, button->lifetime());
button->setClickedCallback([=] {
if (state->confirmButtonBusy) {
return;