From 6ded5b74d09acc1a38c09710cd68d049da95ddfc Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Mon, 24 Feb 2020 13:13:48 +0400
Subject: [PATCH] Fix load requests cancel on history change.

---
 Telegram/SourceFiles/history/history_widget.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp
index 715f9fdf9..68bf3bed4 100644
--- a/Telegram/SourceFiles/history/history_widget.cpp
+++ b/Telegram/SourceFiles/history/history_widget.cpp
@@ -1717,7 +1717,6 @@ void HistoryWidget::showHistory(
 
 	clearReplyReturns();
 	if (_history) {
-		clearAllLoadRequests();
 		if (Ui::InFocusChain(_list)) {
 			// Removing focus from list clears selected and updates top bar.
 			setFocus();
@@ -1736,6 +1735,8 @@ void HistoryWidget::showHistory(
 		destroyPinnedBar();
 		_membersDropdown.destroy();
 		_scrollToAnimation.stop();
+
+		clearAllLoadRequests();
 		_history = _migrated = nullptr;
 		_list = nullptr;
 		_peer = nullptr;