diff --git a/gui/main.qml b/gui/main.qml index acd36d4..6bbb14f 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -313,14 +313,23 @@ ApplicationWindow { boundsBehavior: Flickable.StopAtBounds onCountChanged: { - Qt.callLater(function() { positionViewAtEnd() }) + if (count > 0) { + var idx = count - 1 + Timer.singleShot(0, function() { + positionViewAtIndex(idx, ListView.End) + }) + } } Connections { target: chatModel function onDataChanged() { - if (chatView.atYEnd) - Qt.callLater(function() { chatView.positionViewAtEnd() }) + if (chatView.atYEnd && chatView.count > 0) { + var idx = chatView.count - 1 + Timer.singleShot(0, function() { + chatView.positionViewAtIndex(idx, ListView.End) + }) + } } }