2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Correctly show premium promo for custom reactions.

This commit is contained in:
John Preston
2022-08-30 10:53:07 +04:00
parent a3c110dafa
commit ebf6cea2f5
8 changed files with 75 additions and 47 deletions

View File

@@ -996,7 +996,7 @@ void ReactionPreview::paintEffect(QPainter &p) {
Data::Reactions::Type::Active);
const auto count = ranges::count(list, true, &Data::Reaction::premium);
const auto rows = (count + kReactionsPerRow - 1) / kReactionsPerRow;
const auto inrowmax = (count + rows - 1) / rows;
const auto inrowmax = rows ? ((count + rows - 1) / rows) : 1;
const auto inrowless = (inrowmax * rows - count);
const auto inrowmore = rows - inrowless;
const auto inmaxrows = inrowmore * inrowmax;

View File

@@ -455,9 +455,7 @@ void ReactionsSettingsBox(
button->setClickedCallback([=, id = r.id] {
if (premium && !controller->session().premium()) {
ShowPremiumPreviewBox(
controller,
PremiumPreview::Reactions);
ShowPremiumPreviewBox(controller, PremiumPreview::Reactions);
return;
}
checkButton(button);