Skip to content

Commit 803b30c

Browse files
committed
fix #168, show an error if file/folder creation fails for whatever reason
1 parent 25e4564 commit 803b30c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CreateNewItemDialog(val activity: BaseSimpleActivity, val path: String, va
5050

5151
private fun createDirectory(path: String, alertDialog: AlertDialog, callback: (Boolean) -> Unit) {
5252
when {
53-
activity.needsStupidWritePermissions(this.path) -> activity.handleSAFDialog(path) {
53+
activity.needsStupidWritePermissions(path) -> activity.handleSAFDialog(path) {
5454
val documentFile = activity.getDocumentFile(path.getParentPath())
5555
if (documentFile == null) {
5656
val error = String.format(activity.getString(R.string.could_not_create_folder), path)

app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
253253
CreateNewItemDialog(activity as SimpleActivity, currentPath) {
254254
if (it) {
255255
refreshItems()
256+
} else {
257+
activity?.toast(R.string.unknown_error_occurred)
256258
}
257259
}
258260
}

0 commit comments

Comments
 (0)