Fix past events loading error for invited room
This commit is contained in:
parent
626f464c53
commit
34edf923d0
5
TODO.md
5
TODO.md
|
@ -35,6 +35,11 @@
|
||||||
- Accept/cancel buttons
|
- Accept/cancel buttons
|
||||||
- Transitions
|
- Transitions
|
||||||
|
|
||||||
|
- Restoring UI state:
|
||||||
|
- Sendbox content
|
||||||
|
- Which element was focused
|
||||||
|
- Room member filter field
|
||||||
|
|
||||||
- Combine events so they take less space
|
- Combine events so they take less space
|
||||||
- After combining is implemented, no need to hide our own profile changes.
|
- After combining is implemented, no need to hide our own profile changes.
|
||||||
- Room last activity time in RoomDelegate
|
- Room last activity time in RoomDelegate
|
||||||
|
|
|
@ -212,7 +212,7 @@ class MatrixClient(nio.AsyncClient):
|
||||||
|
|
||||||
|
|
||||||
async def load_past_events(self, room_id: str) -> bool:
|
async def load_past_events(self, room_id: str) -> bool:
|
||||||
if room_id in self.fully_loaded_rooms:
|
if room_id in self.fully_loaded_rooms or room_id in self.invited_rooms:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
await self.first_sync_happened.wait()
|
await self.first_sync_happened.wait()
|
||||||
|
|
|
@ -69,16 +69,20 @@ HRectangle {
|
||||||
// Declaring this as "alias" provides the on... signal
|
// Declaring this as "alias" provides the on... signal
|
||||||
property real yPos: visibleArea.yPosition
|
property real yPos: visibleArea.yPosition
|
||||||
property bool canLoad: true
|
property bool canLoad: true
|
||||||
onYPosChanged: Qt.callLater(loadPastEvents)
|
onYPosChanged: if (canLoad && yPos < 0.1) Qt.callLater(loadPastEvents)
|
||||||
|
|
||||||
function loadPastEvents() {
|
function loadPastEvents() {
|
||||||
if (chatPage.invited_id || ! canLoad || yPos > 0.1) { return }
|
|
||||||
eventList.canLoad = false
|
eventList.canLoad = false
|
||||||
py.callClientCoro(
|
py.callClientCoro(
|
||||||
chatPage.userId, "load_past_events", [chatPage.roomId],
|
chatPage.userId, "load_past_events", [chatPage.roomId],
|
||||||
moreToLoad => { eventList.canLoad = moreToLoad }
|
moreToLoad => { eventList.canLoad = moreToLoad }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property string inviter: chatPage.roomInfo.inviter || ""
|
||||||
|
// When an invited room becomes joined, we should now be able to fetch
|
||||||
|
// past events.
|
||||||
|
onInviterChanged: canLoad = true
|
||||||
}
|
}
|
||||||
|
|
||||||
HNoticePage {
|
HNoticePage {
|
||||||
|
|
|
@ -34,7 +34,6 @@ Python {
|
||||||
|
|
||||||
function saveConfig(backend_attribute, data, callback=null) {
|
function saveConfig(backend_attribute, data, callback=null) {
|
||||||
if (! py.ready) { return } // config not loaded yet
|
if (! py.ready) { return } // config not loaded yet
|
||||||
print(backend_attribute, JSON.stringify( data, null, 4))
|
|
||||||
callCoro(backend_attribute + ".write", [data], callback)
|
callCoro(backend_attribute + ".write", [data], callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user