-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Directory creation error #4244
Directory creation error #4244
Changes from 5 commits
53ed7ee
33e01f3
6731218
29cd68d
e17c0a7
de84314
988e637
0f26eba
b87a928
ca269fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1257,11 +1257,14 @@ define(function (require, exports, module) { | |
(error.name === NativeFileError.TYPE_MISMATCH_ERR)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Almost. I went back to the original bug to test and found some more issues not mentioned. If you create a file with a name You can split the |
||
Dialogs.showModalDialog( | ||
DefaultDialogs.DIALOG_ID_ERROR, | ||
Strings.INVALID_FILENAME_TITLE, | ||
StringUtils.format( | ||
Strings.FILE_ALREADY_EXISTS, | ||
StringUtils.breakableUrl(data.rslt.name) | ||
) | ||
!isFolder ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might also be better to assign the inline if to a variable at the start of the callback and reuse it in the 4 formats, to reduce the line width. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be better? Definitely better. Thanks! |
||
StringUtils.format(Strings.INVALID_FILENAME_TITLE, Strings.FILE) : | ||
StringUtils.format(Strings.INVALID_FILENAME_TITLE, Strings.DIRECTORY), | ||
!isFolder ? | ||
StringUtils.format(Strings.FILE_ALREADY_EXISTS, Strings.FILE, | ||
StringUtils.breakableUrl(data.rslt.name)) : | ||
StringUtils.format(Strings.FILE_ALREADY_EXISTS, Strings.DIRECTORY, | ||
StringUtils.breakableUrl(data.rslt.name)) | ||
); | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this else branch there is another error dialog that always display "File" in the strings as the code fixed. Maybe this could be fixed here too. |
||
var errString = error.name === NativeFileError.NO_MODIFICATION_ALLOWED_ERR ? | ||
|
@@ -1270,12 +1273,12 @@ define(function (require, exports, module) { | |
|
||
Dialogs.showModalDialog( | ||
DefaultDialogs.DIALOG_ID_ERROR, | ||
Strings.ERROR_CREATING_FILE_TITLE, | ||
StringUtils.format( | ||
Strings.ERROR_CREATING_FILE, | ||
StringUtils.breakableUrl(data.rslt.name), | ||
errString | ||
) | ||
isFolder ? StringUtils.format(Strings.ERROR_CREATING_FILE_TITLE, Strings.DIRECTORY) : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify to:
|
||
StringUtils.format(Strings.ERROR_CREATING_FILE_TITLE, Strings.FILE), | ||
isFolder ? StringUtils.format(Strings.ERROR_CREATING_FILE, Strings.DIRECTORY, | ||
StringUtils.breakableUrl(data.rslt.name), errString) : | ||
StringUtils.format(Strings.ERROR_CREATING_FILE, Strings.FILE, | ||
StringUtils.breakableUrl(data.rslt.name), errString) | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably intended to remove
DIRECTORY_ALREADY_EXISTS
right?