Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix

AmanRajSinghMourya1a996b8bf7d5
diff --git a/mobile/apps/locker/lib/utils/file_util.dart b/mobile/apps/locker/lib/utils/file_util.dart
index 7e80ce39d8..74c8ccfa18 100644
--- a/mobile/apps/locker/lib/utils/file_util.dart
+++ b/mobile/apps/locker/lib/utils/file_util.dart
@@ -44,7 +44,11 @@ class FileUtil {
final cachedDecryptedFile = File(getCachedDecryptedFilePath(file));
if (await cachedDecryptedFile.exists()) {
- await _launchFile(context, cachedDecryptedFile, displayName: file.displayName);
+ await _launchFile(
+ context,
+ cachedDecryptedFile,
+ displayName: file.displayName,
+ );
return;
}
@@ -77,7 +81,11 @@ class FileUtil {
await dialog.hide();
if (decryptedFile != null) {
- await _launchFile(context, decryptedFile, displayName: file.displayName);
+ await _launchFile(
+ context,
+ decryptedFile,
+ displayName: file.displayName,
+ );
} else {
await showAlertBottomSheet(
context,
@@ -425,6 +433,12 @@ class FileUtil {
context: context,
error: e,
);
+ } finally {
+ if (fileToOpen.path != file.path) {
+ try {
+ await fileToOpen.delete();
+ } catch (_) {}
+ }
}
}
}