mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 06:07:54 -06:00
Removed suggestions from inbox, added translations, added paging to inbox, visual updates, changed default matching algorithm to auto
This commit is contained in:
@@ -26,6 +26,18 @@ class ConnectivityCubit extends Cubit<ConnectivityState> {
|
||||
}
|
||||
}
|
||||
|
||||
void reload() async {
|
||||
if (_sub == null) {
|
||||
initialize();
|
||||
} else {
|
||||
final bool isConnected =
|
||||
await connectivityStatusService.isConnectedToInternet();
|
||||
emit(isConnected
|
||||
? ConnectivityState.connected
|
||||
: ConnectivityState.notConnected);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_sub?.cancel();
|
||||
|
||||
@@ -8,8 +8,8 @@ class SavedViewRepositoryImpl extends SavedViewRepository {
|
||||
SavedViewRepositoryImpl(this._api) : super(const SavedViewRepositoryState());
|
||||
|
||||
@override
|
||||
Future<SavedView> create(SavedView view) async {
|
||||
final created = await _api.save(view);
|
||||
Future<SavedView> create(SavedView object) async {
|
||||
final created = await _api.save(object);
|
||||
final updatedState = {...state.values}
|
||||
..putIfAbsent(created.id!, () => created);
|
||||
emit(SavedViewRepositoryState(values: updatedState, hasLoaded: true));
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
|
||||
String translateMatchingAlgorithm(
|
||||
BuildContext context, MatchingAlgorithm algorithm) {
|
||||
switch (algorithm) {
|
||||
case MatchingAlgorithm.anyWord:
|
||||
return S.of(context).matchingAlgorithmAnyDescription;
|
||||
case MatchingAlgorithm.allWords:
|
||||
return S.of(context).matchingAlgorithmAllDescription;
|
||||
case MatchingAlgorithm.exactMatch:
|
||||
return S.of(context).matchingAlgorithmExactDescription;
|
||||
case MatchingAlgorithm.regex:
|
||||
return S.of(context).matchingAlgorithmRegexDescription;
|
||||
case MatchingAlgorithm.fuzzy:
|
||||
return S.of(context).matchingAlgorithmFuzzyDescription;
|
||||
case MatchingAlgorithm.auto:
|
||||
return S.of(context).matchingAlgorithmAutoDescription;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user