Skip to content

Commit 91478b8

Browse files
committed
Fix file overwrite when fast return to Cryptomator
Fixes #530
1 parent 8cca589 commit 91478b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,9 @@ class BrowseFilesPresenter @Inject constructor( //
538538
Uri.fromFile(fileUtil.getLegacyFileForMicrosoftWorkaround(cloudFile))
539539
} else {
540540
fileUtil.contentUriFor(cloudFile)
541-
}.also {
542-
openedCloudFile = cloudFile
541+
}
542+
openedCloudFile = cloudFile
543+
uriToOpenedFile?.let {
543544
openedCloudFileMd5 = calculateDigestFromUri(it)
544545
viewFileIntent.setDataAndType(it, mimeTypes.fromFilename(cloudFile.name)?.toString())
545546
viewFileIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)

0 commit comments

Comments
 (0)