fix room watch
This commit is contained in:
parent
292a219ed2
commit
8d9645b460
1 changed files with 5 additions and 3 deletions
|
|
@ -51,11 +51,13 @@ class RoomChatController extends AsyncNotifier<IList<Event>> {
|
|||
const ISet.empty(),
|
||||
);
|
||||
|
||||
final room = ref.watch(RoomsController.provider)[roomId];
|
||||
final room = ref.watch(
|
||||
RoomsController.provider.select((rooms) => rooms[roomId]),
|
||||
);
|
||||
if (room == null) return const IList.empty();
|
||||
|
||||
// While there are under 20 messages, try up to load more messages until there's no more or we have 20 messages.
|
||||
if (room.hasMore && room.events.length < 20) {
|
||||
// While there are under 30 messages, try up to load more messages until there's no more or we have 20 messages.
|
||||
if (room.hasMore && room.events.length < 30) {
|
||||
loadOlder();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue