mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Guarded requests of recent gifts for button from shared media section.
This commit is contained in:
@@ -365,7 +365,7 @@ not_null<Ui::SettingsButton*> AddPeerGiftsButton(
|
|||||||
wrap->toggleOn(rpl::duplicate(forked) | rpl::map(rpl::mappers::_1 > 0));
|
wrap->toggleOn(rpl::duplicate(forked) | rpl::map(rpl::mappers::_1 > 0));
|
||||||
tracker.track(wrap);
|
tracker.track(wrap);
|
||||||
|
|
||||||
navigation->session().recentSharedGifts().request(peer, [=](
|
const auto requestDone = crl::guard(wrap, [=](
|
||||||
std::vector<DocumentId> ids) {
|
std::vector<DocumentId> ids) {
|
||||||
state->emojiList.clear();
|
state->emojiList.clear();
|
||||||
for (const auto &id : ids) {
|
for (const auto &id : ids) {
|
||||||
@@ -374,6 +374,7 @@ not_null<Ui::SettingsButton*> AddPeerGiftsButton(
|
|||||||
}
|
}
|
||||||
state->textRefreshed.fire({});
|
state->textRefreshed.fire({});
|
||||||
});
|
});
|
||||||
|
navigation->session().recentSharedGifts().request(peer, requestDone);
|
||||||
|
|
||||||
state->button = wrap->entity();
|
state->button = wrap->entity();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user