Added start date to subscription entry in credits transactions history.

This commit is contained in:
23rd 2024-11-01 11:22:13 +03:00
parent 7096a4231f
commit 3cfa963f69
2 changed files with 22 additions and 9 deletions

View file

@ -1310,6 +1310,16 @@ void AddSubscriptionEntryTable(
controller,
peerId);
if (!s.until.isNull()) {
if (s.subscription.period > 0) {
const auto subscribed = s.until.addSecs(-s.subscription.period);
if (subscribed.isValid()) {
AddTableRow(
table,
tr::lng_group_invite_joined_row_date(),
rpl::single(
Ui::Text::WithEntities(langDateTime(subscribed))));
}
}
AddTableRow(
table,
s.expired

View file

@ -1212,16 +1212,19 @@ void ReceiptCreditsBox(
}
if (s) {
Ui::AddSkip(content);
box->addRow(object_ptr<Ui::CenterWrap<>>(
auto label = object_ptr<Ui::FlatLabel>(
box,
object_ptr<Ui::FlatLabel>(
box,
s.cancelled
? tr::lng_credits_subscription_off_about()
: tr::lng_credits_subscription_on_about(
lt_date,
rpl::single(langDayOfMonthFull(s.until.date()))),
st::creditsBoxAboutDivider)));
s.cancelled
? tr::lng_credits_subscription_off_about()
: tr::lng_credits_subscription_on_about(
lt_date,
rpl::single(langDayOfMonthFull(s.until.date()))),
st::creditsBoxAboutDivider);
if (s.cancelled) {
label->setTextColorOverride(st::menuIconAttentionColor->c);
}
box->addRow(
object_ptr<Ui::CenterWrap<>>(box, std::move(label)));
}
Ui::AddSkip(content);