Increased pagination limits for recent messages in statistics info.

This commit is contained in:
23rd 2023-11-13 09:18:51 +03:00 committed by John Preston
parent edb7cf197a
commit 98bd5757b0

View file

@ -702,8 +702,9 @@ void InnerWidget::fillRecentPosts() {
container, container,
tr::lng_stories_show_more()))); tr::lng_stories_show_more())));
constexpr auto kPerPage = int(10); constexpr auto kFirstPage = int(10);
const auto max = stats.recentMessageInteractions.size(); constexpr auto kPerPage = int(30);
const auto max = int(stats.recentMessageInteractions.size());
if (_state.recentPostsExpanded) { if (_state.recentPostsExpanded) {
_state.recentPostsExpanded = std::max( _state.recentPostsExpanded = std::max(
_state.recentPostsExpanded - kPerPage, _state.recentPostsExpanded - kPerPage,
@ -712,8 +713,10 @@ void InnerWidget::fillRecentPosts() {
const auto showMore = [=] { const auto showMore = [=] {
const auto from = _state.recentPostsExpanded; const auto from = _state.recentPostsExpanded;
_state.recentPostsExpanded = std::min( _state.recentPostsExpanded = std::min(
int(max), max,
_state.recentPostsExpanded + kPerPage); _state.recentPostsExpanded
? (_state.recentPostsExpanded + kPerPage)
: kFirstPage);
if (_state.recentPostsExpanded == max) { if (_state.recentPostsExpanded == max) {
buttonWrap->toggle(false, anim::type::instant); buttonWrap->toggle(false, anim::type::instant);
} }