slight cleanups

This commit is contained in:
Henry Hiles 2026-09-26 12:41:00 -04:00
commit 6c0d7b6fed
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 11 additions and 7 deletions

View file

@ -90,8 +90,16 @@ class RoomChatController(final (String roomId, String? contextualEvent) info)
); );
Future<void> paginate(Direction direction) async { Future<void> paginate(Direction direction) async {
if (state.isLoading || state.value?.hasMoreBackward == false) return; if (state.isLoading) return;
final chat = await future; final chat = await future;
if (direction == .forward
? chat?.hasMoreForward == false
: chat?.hasMoreBackward == false) {
return;
}
state = .loading(); state = .loading();
final client = ref.read(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);

View file

@ -30,12 +30,8 @@ final class ChatScroll({
final anchorItemKey = useMemoized(GlobalKey.new, [anchorId.value]); final anchorItemKey = useMemoized(GlobalKey.new, [anchorId.value]);
final historyListController = useMemoized(ListController.new, [ final historyListController = useMemoized(ListController.new);
anchorId.value, final liveListController = useMemoized(ListController.new);
]);
final liveListController = useMemoized(ListController.new, [
anchorId.value,
]);
final scrollController = useScrollController(); final scrollController = useScrollController();
final centerKey = useMemoized(GlobalKey.new); final centerKey = useMemoized(GlobalKey.new);