                     self?.hideHeaderStatusView()
                 }
 
-                self?.isRequestingHistory = false
                 self?.loadMoreMessagesFrom(date: date, loadRemoteHistory: false)
+
+                if nextPageDate == nil {
+                    self?.dataController.loadedAllMessages = true
+                    self?.syncCollectionView()
+                }
 
                 if loadNextPage {
                     if let nextPageDate = nextPageDate {
                         self?.loadHistoryFromRemote(date: nextPageDate, loadNextPage: false)
+                    } else {
+                        self?.dataController.loadedAllMessages = true
+                        self?.syncCollectionView()
                     }
-                }
-
-                // There are no new messages
-                if nextPageDate == nil {
-                    self?.dataController.loadedAllMessages = true
-                    self?.syncCollectionView()
                 } else {
                     self?.dataController.loadedAllMessages = false
                 }

        }

        MessageManager.getHistory(tempSubscription, lastMessageDate: date) { [weak self] nextPageDate in
            DispatchQueue.main.async {
                self?.activityIndicator.stopAnimating()


            collectionView?.insertItems(at: indexPaths)
            collectionView?.deleteItems(at: removedIndexPaths)
        }, completion: nil)
    }

    func loadHistoryFromRemote(date: Date?, loadNextPage: Bool = true) {
