Fixed support type of credits history entry for ads in earn section.

This commit is contained in:
23rd 2024-07-04 09:34:27 +03:00 committed by John Preston
parent 054a6db3ae
commit 66d6b461f3
2 changed files with 8 additions and 0 deletions

View file

@ -47,3 +47,5 @@ creditsBoxButtonLabel: FlatLabel(defaultFlatLabel) {
starIconSmall: icon{{ "payments/small_star", windowFg }};
starIconSmallPadding: margins(0px, -2px, 0px, 0px);
creditsHistoryEntryTypeAds: icon {{ "folders/folders_channels", premiumButtonFg }};

View file

@ -205,6 +205,8 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
return { st::historyPeer8UserpicBg, st::historyPeer8UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::PremiumBot:
return { st::historyPeer8UserpicBg, st::historyPeer8UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::Ads:
return { st::historyPeer6UserpicBg, st::historyPeer6UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::Unsupported:
return {
st::historyPeerArchiveUserpicBg,
@ -227,6 +229,8 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
? st::sessionIconAndroid
: (entry.peerType == PeerType::Fragment)
? st::introFragmentIcon
: (entry.peerType == PeerType::Ads)
? st::creditsHistoryEntryTypeAds
: st::dialogsInaccessibleUserpic).paintInCenter(p, rect);
};
}
@ -442,6 +446,8 @@ Fn<PaintRoundImageCallback(Fn<void()>)> PaintPreviewCallback(
TextWithEntities GenerateEntryName(const Data::CreditsHistoryEntry &entry) {
return ((entry.peerType == Data::CreditsHistoryEntry::PeerType::Fragment)
? tr::lng_bot_username_description1_link
: (entry.peerType == Data::CreditsHistoryEntry::PeerType::Ads)
? tr::lng_credits_box_history_entry_ads
: tr::lng_credits_summary_history_entry_inner_in)(
tr::now,
TextWithEntities::Simple);