fix: Do not load timeline while sync is processed

This sometimes lead to the
problem that the timeline misses
the newest messages. Especially
when opening the app from a
notification this can happen.
This commit is contained in:
Krille 2025-05-04 13:24:28 +02:00
parent 40fb163cdf
commit 1275f752f3
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 8 additions and 6 deletions

View File

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