fix #168, show an error if file/folder creation fails for whatever reason
This commit is contained in:
parent
25e4564b1e
commit
803b30c59c
2 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,7 @@ class CreateNewItemDialog(val activity: BaseSimpleActivity, val path: String, va
|
|||
|
||||
private fun createDirectory(path: String, alertDialog: AlertDialog, callback: (Boolean) -> Unit) {
|
||||
when {
|
||||
activity.needsStupidWritePermissions(this.path) -> activity.handleSAFDialog(path) {
|
||||
activity.needsStupidWritePermissions(path) -> activity.handleSAFDialog(path) {
|
||||
val documentFile = activity.getDocumentFile(path.getParentPath())
|
||||
if (documentFile == null) {
|
||||
val error = String.format(activity.getString(R.string.could_not_create_folder), path)
|
||||
|
|
|
@ -253,6 +253,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||
CreateNewItemDialog(activity as SimpleActivity, currentPath) {
|
||||
if (it) {
|
||||
refreshItems()
|
||||
} else {
|
||||
activity?.toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue