mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Open ready-preloaded TON section.
This commit is contained in:
@@ -249,10 +249,23 @@ bool PremiumGift::buttonMinistars() {
|
|||||||
|
|
||||||
ClickHandlerPtr PremiumGift::createViewLink() {
|
ClickHandlerPtr PremiumGift::createViewLink() {
|
||||||
if (tonGift()) {
|
if (tonGift()) {
|
||||||
|
const auto lifetime = std::make_shared<rpl::lifetime>();
|
||||||
return std::make_shared<LambdaClickHandler>([=](ClickContext context) {
|
return std::make_shared<LambdaClickHandler>([=](ClickContext context) {
|
||||||
const auto my = context.other.value<ClickHandlerContext>();
|
const auto my = context.other.value<ClickHandlerContext>();
|
||||||
if (const auto window = my.sessionWindow.get()) {
|
const auto weak = my.sessionWindow;
|
||||||
window->showSettings(Settings::CreditsId());
|
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());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user