Reduce the number of room delegate errors

This commit is contained in:
miruka 2020-04-14 10:55:01 -04:00
parent 6536f89507
commit 01adcff77e
3 changed files with 17 additions and 6 deletions

View File

@ -761,6 +761,7 @@ class MatrixClient(nio.AsyncClient):
# If a new room was added, wait for onSyncResponse to set the token
await asyncio.sleep(0.1)
print( self.lazy_load_filter)
response = await self.room_messages(
room_id = room_id,
start = self.past_tokens[room_id],

View File

@ -21,6 +21,8 @@ Column {
readonly property alias collapsed: account.collapsed
readonly property alias roomList: roomList
onFirstSyncDoneChanged: print("fsd")
Account {
id: account
@ -55,7 +57,11 @@ Column {
}
delegate: HLoader {
active: firstSyncDone && (inView || model.index === 0)
asynchronous: false
active: firstSyncDone && inView
onInViewChanged: print("iv")
width: roomList.width
height: roomList.firstDelegateHeight
@ -80,13 +86,17 @@ Column {
highlight: null // managed by the AccountRoomsList
onFirstDelegateHeightChanged: firstDelegateHeight = firstDelegateHeight
// Delete 0 must *always* be loaded, and all delegates must have the
// same height
readonly property int firstDelegateHeight:
property int firstDelegateHeight:
contentItem.visibleChildren[0] ?
contentItem.visibleChildren[0].implicitHeight :
0
property var pr: firstDelegateHeight
onPrChanged: print("pr changed:", pr)
readonly property bool hasActiveRoom:
window.uiState.page === "Pages/Chat/Chat.qml" &&

View File

@ -51,13 +51,13 @@ QtObject {
function onModelItemSet(syncId, indexThen, indexNow, changedFields){
if (indexThen === undefined) {
print("insert", syncId, indexThen, indexNow,
JSON.stringify(changedFields))
// print("insert", syncId, indexThen, indexNow,
// JSON.stringify(changedFields))
ModelStore.get(syncId).insert(indexNow, changedFields)
} else {
print("set", syncId, indexThen, indexNow,
JSON.stringify(changedFields))
// print("set", syncId, indexThen, indexNow,
// JSON.stringify(changedFields))
const model = ModelStore.get(syncId)
model.set(indexThen, changedFields)
if (indexThen !== indexNow) model.move(indexThen, indexNow, 1)