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
@@ -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);
}
}