slight cleanups
This commit is contained in:
parent
5b58573762
commit
6c0d7b6fed
2 changed files with 11 additions and 7 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue