diff --git a/lib/controllers/room_chat_controller.dart b/lib/controllers/room_chat_controller.dart index 9f4796b..f37716f 100644 --- a/lib/controllers/room_chat_controller.dart +++ b/lib/controllers/room_chat_controller.dart @@ -51,11 +51,13 @@ class RoomChatController extends AsyncNotifier> { 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(); }