implemented Nextcloud file previews for unknown file types using fileId and has-preview flags, updated file models, and refined manual refresh logic.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import '../../../../../api/errors/error_mapper.dart';
|
||||
@@ -42,6 +44,16 @@ class FilesBloc
|
||||
await _query(path, renew: true);
|
||||
}
|
||||
|
||||
/// LoadableState.reFetch (used by the pull-to-refresh indicator and the
|
||||
/// error-screen retry button) routes through here. The inherited retry()
|
||||
/// goes via gatherData() which respects the cache TTL — for an explicit
|
||||
/// user-initiated reload we must bypass it, otherwise the root listing
|
||||
/// silently returns its day-old cached payload without hitting the server.
|
||||
@override
|
||||
void retry() {
|
||||
unawaited(refresh());
|
||||
}
|
||||
|
||||
Future<void> setPath(List<String> path) async {
|
||||
add(Emit((s) => s.copyWith(currentPath: path, listing: null)));
|
||||
add(RefetchStarted<FilesState>());
|
||||
|
||||
Reference in New Issue
Block a user