Merge branch 'room-fix-storeless-timeline' into 'master'
[Room] Fix storeless timeline See merge request famedly/famedlysdk!167
This commit is contained in:
commit
bc2ca9749c
|
@ -729,19 +729,19 @@ class Room {
|
||||||
Future<Timeline> getTimeline(
|
Future<Timeline> getTimeline(
|
||||||
{onTimelineUpdateCallback onUpdate,
|
{onTimelineUpdateCallback onUpdate,
|
||||||
onTimelineInsertCallback onInsert}) async {
|
onTimelineInsertCallback onInsert}) async {
|
||||||
List<Event> events = [];
|
List<Event> events =
|
||||||
if (client.store != null) {
|
client.store != null ? await client.store.getEventList(this) : [];
|
||||||
events = await client.store.getEventList(this);
|
Timeline timeline = Timeline(
|
||||||
} else {
|
|
||||||
prev_batch = "";
|
|
||||||
await requestHistory();
|
|
||||||
}
|
|
||||||
return Timeline(
|
|
||||||
room: this,
|
room: this,
|
||||||
events: events,
|
events: events,
|
||||||
onUpdate: onUpdate,
|
onUpdate: onUpdate,
|
||||||
onInsert: onInsert,
|
onInsert: onInsert,
|
||||||
);
|
);
|
||||||
|
if (client.store == null) {
|
||||||
|
prev_batch = "";
|
||||||
|
await requestHistory();
|
||||||
|
}
|
||||||
|
return timeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Load all participants for a given room from the store.
|
/// Load all participants for a given room from the store.
|
||||||
|
|
Loading…
Reference in a new issue