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:
parent
40fb163cdf
commit
1275f752f3
|
|
@ -1525,14 +1525,16 @@ class Room {
|
||||||
}) async {
|
}) async {
|
||||||
await postLoad();
|
await postLoad();
|
||||||
|
|
||||||
List<Event> events;
|
var events = <Event>[];
|
||||||
|
|
||||||
if (!isArchived) {
|
if (!isArchived) {
|
||||||
events = await client.database?.getEventList(
|
await client.database?.transaction(() async {
|
||||||
this,
|
events = await client.database?.getEventList(
|
||||||
limit: limit,
|
this,
|
||||||
) ??
|
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() ?? [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue