From 98bd5757b0d8262a1aaf2aee5fee0b39f193d5b4 Mon Sep 17 00:00:00 2001
From: 23rd <23rd@vivaldi.net>
Date: Mon, 13 Nov 2023 09:18:51 +0300
Subject: [PATCH] Increased pagination limits for recent messages in statistics
 info.

---
 .../info/statistics/info_statistics_inner_widget.cpp  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp b/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
index 237453d6e..694c67fb5 100644
--- a/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
+++ b/Telegram/SourceFiles/info/statistics/info_statistics_inner_widget.cpp
@@ -702,8 +702,9 @@ void InnerWidget::fillRecentPosts() {
 				container,
 				tr::lng_stories_show_more())));
 
-	constexpr auto kPerPage = int(10);
-	const auto max = stats.recentMessageInteractions.size();
+	constexpr auto kFirstPage = int(10);
+	constexpr auto kPerPage = int(30);
+	const auto max = int(stats.recentMessageInteractions.size());
 	if (_state.recentPostsExpanded) {
 		_state.recentPostsExpanded = std::max(
 			_state.recentPostsExpanded - kPerPage,
@@ -712,8 +713,10 @@ void InnerWidget::fillRecentPosts() {
 	const auto showMore = [=] {
 		const auto from = _state.recentPostsExpanded;
 		_state.recentPostsExpanded = std::min(
-			int(max),
-			_state.recentPostsExpanded + kPerPage);
+			max,
+			_state.recentPostsExpanded
+				? (_state.recentPostsExpanded + kPerPage)
+				: kFirstPage);
 		if (_state.recentPostsExpanded == max) {
 			buttonWrap->toggle(false, anim::type::instant);
 		}