mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 10:08:02 -06:00
feat: Update translations, add pdf view to document edit page
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/notifier/document_changed_notifier.dart';
|
||||
@@ -21,11 +22,12 @@ mixin DocumentPagingBlocMixin<State extends DocumentPagingState>
|
||||
Future<void> loadMore() async {
|
||||
final hasConnection =
|
||||
await connectivityStatusService.isConnectedToInternet();
|
||||
if (state.isLastPageLoaded || !hasConnection) {
|
||||
if (state.isLastPageLoaded || !hasConnection || state.isLoading) {
|
||||
return;
|
||||
}
|
||||
emit(state.copyWithPaged(isLoading: true));
|
||||
final newFilter = state.filter.copyWith(page: state.filter.page + 1);
|
||||
debugPrint("Fetching page ${newFilter.page}");
|
||||
try {
|
||||
final result = await api.findAll(newFilter);
|
||||
emit(
|
||||
@@ -217,7 +219,6 @@ mixin DocumentPagingBlocMixin<State extends DocumentPagingState>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
notifier.removeListener(this);
|
||||
|
||||
Reference in New Issue
Block a user