added cache folder sweep check before file actions, preventing errors
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user