Improve room past events loading
- Trigger when room is shown if there's not enough messages to fill the list height - Trigger whenever user is scrolling before a certain point, instead of when dragging is released/scrolling stopped and the top edge is hit - Prevent multiple load requests at same time - Keep a set of fully loaded rooms, don't request anymore history if a room is fully loaded
This commit is contained in:
@@ -26,8 +26,14 @@ Rectangle {
|
||||
// reloaded from network.
|
||||
cacheBuffer: height * 6
|
||||
|
||||
onMovementEnded: if (atYBeginning) {
|
||||
Backend.loadPastEvents(chatPage.room.room_id)
|
||||
// Declaring this "alias" provides the on... signal
|
||||
property real yPos: visibleArea.yPosition
|
||||
|
||||
onYPosChanged: {
|
||||
console.log(yPos)
|
||||
if (yPos <= 0.1) {
|
||||
Backend.loadPastEvents(chatPage.room.room_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user