added cache folder sweep check before file actions, preventing errors

This commit is contained in:
2026-08-07 21:36:09 +02:00
parent 62fa337188
commit b9cb1df473
4 changed files with 98 additions and 7 deletions
+5 -1
View File
@@ -10,6 +10,7 @@ import '../../view/pages/files/data/file_type_icon.dart';
import '../centered_leading.dart';
import '../details_bottom_sheet.dart';
import '../info_dialog.dart';
import 'stale_download_guard.dart';
/// Overview of all active and finished-but-unopened downloads. Lets the user
/// open/switch between finished files, cancel running ones and retry failures.
@@ -86,8 +87,11 @@ class _DownloadsListState extends State<_DownloadsList> {
void _open(DownloadJob job) {
final path = job.localPath;
if (path == null) return;
Haptics.success();
// Pop the sheet first so a stale-file dialog lands on the underlying
// screen instead of an emptied sheet.
Navigator.of(widget.sheetContext).pop();
if (!ensureDownloadStillExists(widget.rootContext, job)) return;
Haptics.success();
DownloadManager.instance.markOpened(job);
AppRoutes.openFileViewer(
widget.rootContext,