diff --git a/ChatView/ChatModel.cpp b/ChatView/ChatModel.cpp index ce56563..df382eb 100644 --- a/ChatView/ChatModel.cpp +++ b/ChatView/ChatModel.cpp @@ -202,7 +202,7 @@ void ChatModel::resetModelTo(int index) if (index < 0 || index >= m_messages.size()) return; - if (index < m_messages.size() - 1) { + if (index < m_messages.size()) { beginRemoveRows(QModelIndex(), index, m_messages.size() - 1); m_messages.remove(index, m_messages.size() - index); endRemoveRows(); diff --git a/ChatView/qml/ChatItem.qml b/ChatView/qml/ChatItem.qml index c0c62cd..9ae570d 100644 --- a/ChatView/qml/ChatItem.qml +++ b/ChatView/qml/ChatItem.qml @@ -140,8 +140,7 @@ Rectangle { anchors { right: parent.right - bottom: parent.bottom - bottomMargin: 2 + top: parent.top } text: qsTr("ResetTo")