diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 7525c8e..6e42e21 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -83,7 +83,7 @@ void ChatModel::initialize(const QVariantMap &chatInformation) void ChatModel::triggerLoadMoreHistory() { - if (!this->inIncrementalUpdate) { + if (!this->inIncrementalUpdate && !messages.isEmpty()) { qDebug() << "[ChatModel] Trigger loading older history..."; this->inIncrementalUpdate = true; this->tdLibWrapper->getChatHistory(this->chatId, this->messages.first().toMap().value("id").toLongLong());