mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-21 21:22:50 +02:00
Open ready-preloaded TON section.
This commit is contained in:
parent
49f580a36b
commit
ef280dae3e
1 changed files with 15 additions and 2 deletions
|
@ -249,10 +249,23 @@ bool PremiumGift::buttonMinistars() {
|
|||
|
||||
ClickHandlerPtr PremiumGift::createViewLink() {
|
||||
if (tonGift()) {
|
||||
const auto lifetime = std::make_shared<rpl::lifetime>();
|
||||
return std::make_shared<LambdaClickHandler>([=](ClickContext context) {
|
||||
const auto my = context.other.value<ClickHandlerContext>();
|
||||
if (const auto window = my.sessionWindow.get()) {
|
||||
window->showSettings(Settings::CreditsId());
|
||||
const auto weak = my.sessionWindow;
|
||||
if (const auto window = weak.get()) {
|
||||
window->session().credits().tonLoad();
|
||||
*lifetime = window->session().credits().tonLoadedValue(
|
||||
) | rpl::filter([=] {
|
||||
if (const auto window = weak.get()) {
|
||||
return window->session().credits().tonLoaded();
|
||||
}
|
||||
return false;
|
||||
}) | rpl::take(1) | rpl::start_with_next([=] {
|
||||
if (const auto window = weak.get()) {
|
||||
window->showSettings(Settings::CurrencyId());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue