🐛 Fixes in new pagination list
This commit is contained in:
@@ -45,11 +45,12 @@ mixin AsyncPaginationController<T> on AsyncNotifier<List<T>>
|
||||
return await fetch();
|
||||
});
|
||||
state = newState;
|
||||
fetchedCount = newState.value?.length ?? 0;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fetchFurther() async {
|
||||
if (!fetchedAll) return;
|
||||
if (fetchedAll) return;
|
||||
|
||||
state = AsyncLoading<List<T>>();
|
||||
|
||||
@@ -67,6 +68,7 @@ mixin AsyncPaginationFilter<F, T> on AsyncPaginationController<T>
|
||||
implements PaginationFiltered<F> {
|
||||
@override
|
||||
Future<void> applyFilter(F filter) async {
|
||||
if (currentFilter == filter) return;
|
||||
// Reset the data
|
||||
totalCount = null;
|
||||
fetchedCount = 0;
|
||||
|
||||
@@ -23,7 +23,11 @@ class ActivityListNotifier extends AsyncNotifier<List<SnTimelineEvent>>
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final cursor =
|
||||
state.valueOrNull?.lastOrNull?.createdAt.toUtc().toIso8601String();
|
||||
state.isLoading
|
||||
? null
|
||||
: state.valueOrNull?.lastOrNull?.createdAt
|
||||
.toUtc()
|
||||
.toIso8601String();
|
||||
|
||||
final queryParameters = {
|
||||
if (cursor != null) 'cursor': cursor,
|
||||
|
||||
Reference in New Issue
Block a user