Merge branch 'room-fix-storeless-timeline' into 'master'

[Room] Fix storeless timeline

See merge request famedly/famedlysdk!167
This commit is contained in:
Christian Pauly 2020-01-23 10:52:22 +00:00
commit bc2ca9749c
1 changed files with 8 additions and 8 deletions

View File

@ -729,19 +729,19 @@ class Room {
Future<Timeline> getTimeline(
{onTimelineUpdateCallback onUpdate,
onTimelineInsertCallback onInsert}) async {
List<Event> events = [];
if (client.store != null) {
events = await client.store.getEventList(this);
} else {
prev_batch = "";
await requestHistory();
}
return Timeline(
List<Event> events =
client.store != null ? await client.store.getEventList(this) : [];
Timeline timeline = Timeline(
room: this,
events: events,
onUpdate: onUpdate,
onInsert: onInsert,
);
if (client.store == null) {
prev_batch = "";
await requestHistory();
}
return timeline;
}
/// Load all participants for a given room from the store.