Don't try to load more messages than there are in the timeline

The function call from qml is removed because it is redundant
This commit is contained in:
Tobias Fella
2022-02-28 23:56:50 +01:00
parent aef6d6fc85
commit 7362b90c42
2 changed files with 1 additions and 7 deletions

View File

@@ -407,12 +407,6 @@ Kirigami.ScrollablePage {
}
Component.onCompleted: {
if (currentRoom) {
if (currentRoom.timelineSize < 20) {
currentRoom.getPreviousContent(50);
}
}
positionViewAtBeginning();
}

View File

@@ -88,7 +88,7 @@ void MessageEventModel::setRoom(NeoChatRoom *room)
if (room) {
m_lastReadEventIndex = QPersistentModelIndex(QModelIndex());
room->setDisplayed();
if (m_currentRoom->timelineSize() < 10) {
if (m_currentRoom->timelineSize() < 10 && !room->allHistoryLoaded()) {
room->getPreviousContent(50);
}
lastReadEventId = room->readMarkerEventId();