[Room] Fix storeless timeline

This commit is contained in:
Christian Pauly 2020-01-23 10:43:01 +00:00
parent bb77a87c98
commit 82c8120c1b

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.