mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Preload premium previews even with Close button.
This commit is contained in:
parent
0a81246502
commit
08ebff4e5d
1 changed files with 9 additions and 5 deletions
|
@ -1454,7 +1454,14 @@ void PreviewBox(
|
|||
box->addRow(
|
||||
CreateSwitch(box->verticalLayout(), &state->selected),
|
||||
st::premiumDotsMargin);
|
||||
const auto showFinished = [=] {
|
||||
state->showFinished = true;
|
||||
if (base::take(state->preloadScheduled)) {
|
||||
state->preload();
|
||||
}
|
||||
};
|
||||
if (descriptor.fromSettings && controller->session().premium()) {
|
||||
box->setShowFinishedCallback(showFinished);
|
||||
box->addButton(tr::lng_close(), [=] { box->closeBox(); });
|
||||
} else {
|
||||
box->setStyle(st::premiumPreviewBox);
|
||||
|
@ -1485,11 +1492,8 @@ void PreviewBox(
|
|||
Settings::LookupPremiumRef(state->selected.current()));
|
||||
});
|
||||
}
|
||||
box->setShowFinishedCallback([=, raw = button.data()] {
|
||||
state->showFinished = true;
|
||||
if (base::take(state->preloadScheduled)) {
|
||||
state->preload();
|
||||
}
|
||||
box->setShowFinishedCallback([=, raw = button.data()]{
|
||||
showFinished();
|
||||
raw->startGlareAnimation();
|
||||
});
|
||||
box->addButton(std::move(button));
|
||||
|
|
Loading…
Add table
Reference in a new issue