mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 14:08:00 -06:00
Updated onboarding, reformatted files, improved referenced documents view, updated error handling
This commit is contained in:
@@ -17,12 +17,15 @@ class ConnectivityStatusServiceImpl implements ConnectivityStatusService {
|
||||
|
||||
@override
|
||||
Stream<bool> connectivityChanges() {
|
||||
return connectivity.onConnectivityChanged.map(_hasActiveInternetConnection).asBroadcastStream();
|
||||
return connectivity.onConnectivityChanged
|
||||
.map(_hasActiveInternetConnection)
|
||||
.asBroadcastStream();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isConnectedToInternet() async {
|
||||
return _hasActiveInternetConnection(await (Connectivity().checkConnectivity()));
|
||||
return _hasActiveInternetConnection(
|
||||
await (Connectivity().checkConnectivity()));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -13,8 +13,8 @@ import 'package:injectable/injectable.dart';
|
||||
import 'package:web_socket_channel/io.dart';
|
||||
|
||||
abstract class StatusService {
|
||||
Future<void> startListeningBeforeDocumentUpload(
|
||||
String httpUrl, AuthenticationInformation credentials, String documentFileName);
|
||||
Future<void> startListeningBeforeDocumentUpload(String httpUrl,
|
||||
AuthenticationInformation credentials, String documentFileName);
|
||||
}
|
||||
|
||||
@Singleton(as: StatusService)
|
||||
@@ -86,9 +86,11 @@ class LongPollingStatusService implements StatusService {
|
||||
|
||||
do {
|
||||
final response = await httpClient.get(
|
||||
Uri.parse('$httpUrl/api/documents/?query=$documentFileName added:${formatDate(today)}'),
|
||||
Uri.parse(
|
||||
'$httpUrl/api/documents/?query=$documentFileName added:${formatDate(today)}'),
|
||||
);
|
||||
final data = PagedSearchResult.fromJson(jsonDecode(response.body), DocumentModel.fromJson);
|
||||
final data = PagedSearchResult.fromJson(
|
||||
jsonDecode(response.body), DocumentModel.fromJson);
|
||||
if (data.count > 0) {
|
||||
consumptionFinished = true;
|
||||
final docId = data.results[0].id;
|
||||
|
||||
Reference in New Issue
Block a user