Past events loading (with two bugs)
This commit is contained in:
@@ -34,15 +34,23 @@ HRectangle {
|
||||
// reloaded from network.
|
||||
cacheBuffer: height * 6
|
||||
|
||||
// Declaring this "alias" provides the on... signal
|
||||
// Declaring this as "alias" provides the on... signal
|
||||
property real yPos: visibleArea.yPosition
|
||||
|
||||
property bool canLoad: true
|
||||
property int zz: 0
|
||||
|
||||
onYPosChanged: {
|
||||
if (chatPage.category != "Invites" && yPos <= 0.1) {
|
||||
if (chatPage.category != "Invites" && canLoad && yPos <= 0.1) {
|
||||
zz += 1
|
||||
print(zz)
|
||||
//Backend.loadPastEvents(chatPage.roomId)
|
||||
print(canLoad, zz)
|
||||
canLoad = false
|
||||
py.callClientCoro(
|
||||
chatPage.userId,
|
||||
"load_past_events",
|
||||
[chatPage.roomId],
|
||||
{},
|
||||
function(more_to_load) { canLoad = more_to_load }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -86,13 +86,13 @@ function onTimelineEventReceived(
|
||||
"senderId": sender_id,
|
||||
"content": content,
|
||||
"isLocalEcho": true
|
||||
}, 1, 500)
|
||||
}, 1, 250)
|
||||
|
||||
if (found.length > 0) {
|
||||
timelines.set(found[0], item)
|
||||
} else {
|
||||
// Multiple clients will emit duplicate events with the same eventId
|
||||
timelines.upsert({"eventId": event_id}, item, true, 500)
|
||||
timelines.upsert({"eventId": event_id}, item, true, 250)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user