2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Guarded requests of recent gifts for button from shared media section.

This commit is contained in:
23rd
2025-07-02 09:41:42 +03:00
committed by John Preston
parent 71f3a1f7cf
commit 7253d764d2

View File

@@ -365,7 +365,7 @@ not_null<Ui::SettingsButton*> AddPeerGiftsButton(
wrap->toggleOn(rpl::duplicate(forked) | rpl::map(rpl::mappers::_1 > 0));
tracker.track(wrap);
navigation->session().recentSharedGifts().request(peer, [=](
const auto requestDone = crl::guard(wrap, [=](
std::vector<DocumentId> ids) {
state->emojiList.clear();
for (const auto &id : ids) {
@@ -374,6 +374,7 @@ not_null<Ui::SettingsButton*> AddPeerGiftsButton(
}
state->textRefreshed.fire({});
});
navigation->session().recentSharedGifts().request(peer, requestDone);
state->button = wrap->entity();