Replaced separate click handlers for each spoiler entry with single one.

This commit is contained in:
23rd 2022-08-16 19:01:50 +03:00 committed by John Preston
parent 27063167ae
commit ef543d040e
2 changed files with 3 additions and 4 deletions

View File

@ -46,10 +46,9 @@ void AnimatedSpoilerClickHandler::onClick(ClickContext context) const {
} // namespace
void FillTextWithAnimatedSpoilers(Ui::Text::String &text) {
const auto link = std::make_shared<AnimatedSpoilerClickHandler>();
for (auto i = 0; i < text.spoilersCount(); i++) {
text.setSpoiler(
i + 1,
std::make_shared<AnimatedSpoilerClickHandler>());
text.setSpoiler(i + 1, link);
}
}

@ -1 +1 @@
Subproject commit 2f5d5e0e79bf52ab04047bc93a4b624d6d33d46a
Subproject commit 1cc74a41c4d1c3fe9824e4bf47c23e3bcd1759e6