Merge branch 'room-timeline-onupdate' into 'main'
feat: expose Timeline.onChange to Room.getTimeline See merge request famedly/company/frontend/famedlysdk!943
This commit is contained in:
commit
f8a2a603ad
|
|
@ -1117,9 +1117,12 @@ class Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a timeline from the store. Returns a [Timeline] object.
|
/// Creates a timeline from the store. Returns a [Timeline] object.
|
||||||
Future<Timeline> getTimeline(
|
Future<Timeline> getTimeline({
|
||||||
{void Function()? onUpdate,
|
void Function(int index)? onChange,
|
||||||
void Function(int insertID)? onInsert}) async {
|
void Function(int index)? onRemove,
|
||||||
|
void Function(int insertID)? onInsert,
|
||||||
|
void Function()? onUpdate,
|
||||||
|
}) async {
|
||||||
await postLoad();
|
await postLoad();
|
||||||
var events;
|
var events;
|
||||||
events = await client.database?.getEventList(
|
events = await client.database?.getEventList(
|
||||||
|
|
@ -1144,8 +1147,10 @@ class Room {
|
||||||
final timeline = Timeline(
|
final timeline = Timeline(
|
||||||
room: this,
|
room: this,
|
||||||
events: events,
|
events: events,
|
||||||
onUpdate: onUpdate,
|
onChange: onChange,
|
||||||
|
onRemove: onRemove,
|
||||||
onInsert: onInsert,
|
onInsert: onInsert,
|
||||||
|
onUpdate: onUpdate,
|
||||||
);
|
);
|
||||||
if (client.database == null) {
|
if (client.database == null) {
|
||||||
await requestHistory(historyCount: 10);
|
await requestHistory(historyCount: 10);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue