mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added support for credits gift options to list of credit options.
This commit is contained in:
parent
127f651d5e
commit
24b93a5eff
3 changed files with 10 additions and 4 deletions
|
@ -289,7 +289,8 @@ void Credits::setupContent() {
|
|||
Ui::StartFireworks(_parent);
|
||||
}
|
||||
};
|
||||
FillCreditOptions(_controller->uiShow(), content, 0, paid);
|
||||
const auto self = _controller->session().user();
|
||||
FillCreditOptions(_controller->uiShow(), content, self, 0, paid);
|
||||
setupHistory(content);
|
||||
|
||||
Ui::ResizeFitChild(this, content);
|
||||
|
|
|
@ -231,6 +231,7 @@ void AddViewMediaHandler(
|
|||
void FillCreditOptions(
|
||||
std::shared_ptr<Main::SessionShow> show,
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
not_null<PeerData*> peer,
|
||||
int minimumCredits,
|
||||
Fn<void()> paid) {
|
||||
const auto options = container->add(
|
||||
|
@ -351,8 +352,7 @@ void FillCreditOptions(
|
|||
};
|
||||
|
||||
using ApiOptions = Api::CreditsTopupOptions;
|
||||
const auto apiCredits = content->lifetime().make_state<ApiOptions>(
|
||||
show->session().user());
|
||||
const auto apiCredits = content->lifetime().make_state<ApiOptions>(peer);
|
||||
|
||||
if (show->session().premiumPossible()) {
|
||||
apiCredits->request(
|
||||
|
@ -864,7 +864,11 @@ void SmallBalanceBox(
|
|||
}));
|
||||
}();
|
||||
|
||||
FillCreditOptions(show, box->verticalLayout(), creditsNeeded, done);
|
||||
{
|
||||
const auto content = box->verticalLayout();
|
||||
const auto self = show->session().user();
|
||||
FillCreditOptions(show, content, self, creditsNeeded, done);
|
||||
}
|
||||
|
||||
content->setMaximumHeight(st::creditsLowBalancePremiumCoverHeight);
|
||||
content->setMinimumHeight(st::infoLayerTopBarHeight);
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Settings {
|
|||
void FillCreditOptions(
|
||||
std::shared_ptr<Main::SessionShow> show,
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
not_null<PeerData*> peer,
|
||||
int minCredits,
|
||||
Fn<void()> paid);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue