Merge pull request #2076 from famedly/krille/do-not-load-timeline-while-sync-processing

fix: Do not load timeline while sync is processed
This commit is contained in:
Krille-chan 2025-05-05 08:29:10 +02:00 committed by GitHub
commit ecf0d6bb94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -1525,14 +1525,16 @@ class Room {
}) async { }) async {
await postLoad(); await postLoad();
List<Event> events; var events = <Event>[];
if (!isArchived) { if (!isArchived) {
await client.database?.transaction(() async {
events = await client.database?.getEventList( events = await client.database?.getEventList(
this, this,
limit: limit, limit: limit,
) ?? ) ??
<Event>[]; <Event>[];
});
} else { } else {
final archive = client.getArchiveRoomFromCache(id); final archive = client.getArchiveRoomFromCache(id);
events = archive?.timeline.events.toList() ?? []; events = archive?.timeline.events.toList() ?? [];