diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt index c52ba95c8..d67a99e33 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/CopyDialog.kt @@ -59,8 +59,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c } if (files.size == 1) { - val newFile = File(files[0].path) - if (File(destinationPath, newFile.name).exists()) { + if (File(destinationPath, files[0].name).exists()) { context.toast(R.string.already_exists) return@setOnClickListener } @@ -78,6 +77,10 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c dismiss() } else { if (context.isPathOnSD(sourcePath) || context.isPathOnSD(destinationPath)) { + if (activity.isShowingPermDialog(files[0])) { + return@setOnClickListener + } + context.toast(R.string.moving) val pair = Pair, File>(files, destinationDir) CopyMoveTask(context, true, config.treeUri, true, copyMoveListener).execute(pair)