Merge branch 'nico/simplify-getTimeline-a-tiny-bit' into 'main'

chore: simplify getTimeline condition a bit

See merge request famedly/company/frontend/famedlysdk!1103
This commit is contained in:
Krille Fear 2022-08-16 15:27:20 +00:00
commit 61466c82c9
1 changed files with 1 additions and 4 deletions

View File

@ -1351,10 +1351,7 @@ class Room {
var chunk = TimelineChunk(events: events);
// Load the timeline arround eventContextId if set
if (eventContextId != null) {
if (events.firstWhereOrNull((event) => event.eventId == eventContextId) !=
null) {
chunk = TimelineChunk(events: events);
} else {
if (!events.any((Event event) => event.eventId == eventContextId)) {
chunk =
await getEventContext(eventContextId) ?? TimelineChunk(events: []);
}