fix: timeline pagination
This commit is contained in:
parent
3eb39e6782
commit
1723a0691a
1 changed files with 1 additions and 2 deletions
|
|
@ -37,8 +37,7 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
|
||||||
room = ref.read(RoomsController.provider)[roomId] ?? room;
|
room = ref.read(RoomsController.provider)[roomId] ?? room;
|
||||||
}
|
}
|
||||||
|
|
||||||
// While there are under 20 events, try to load more
|
// Load one more page when the initial timeline is short.
|
||||||
// until there's no more or the conditions are met.
|
|
||||||
if (room.hasMore && room.timeline.length < 20) {
|
if (room.hasMore && room.timeline.length < 20) {
|
||||||
await loadOlder();
|
await loadOlder();
|
||||||
room = ref.read(RoomsController.provider)[roomId] ?? room;
|
room = ref.read(RoomsController.provider)[roomId] ?? room;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue