Skip to content

Commit a64c10a

Browse files
committed
more bug fixes
1 parent 4b38457 commit a64c10a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

js/common/file_dialog.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,8 @@ class FileDialog extends GenericModal {
436436
}
437437

438438
for (let filename of filenames) {
439-
await this._showBusy(this._fileHelper.delete(filename));
440439
// Delete the item
441-
await this._showBusy(this._fileHelper.delete(this._currentPath + filename));
440+
await this._showBusy(this._fileHelper.delete(filename));
442441
}
443442

444443
// Refresh the file list
@@ -641,6 +640,10 @@ class FileDialog extends GenericModal {
641640
if (!this._canPerformWritableFileOperation()) return;
642641

643642
let oldName = this._getSelectedFilenames();
643+
if (oldName.length != 1) {
644+
return;
645+
}
646+
oldName = oldName[0];
644647
let newName = prompt("Enter a new folder name", oldName);
645648
// If cancelled, do nothing
646649
if (!newName) {
@@ -763,13 +766,10 @@ class FileDialog extends GenericModal {
763766
let filetype, filename;
764767
let selectedItem = this._getSelectedFiles();
765768
if (selectedItem.length > 1) {
769+
// We don't currently support opening multiple items
766770
return;
767771
}
768-
if (selectedItem.length == 1) {
769-
selectedItem = selectedItem[0];
770-
} else {
771-
selectedItem = null;
772-
}
772+
selectedItem = selectedItem.length == 1 ? selectedItem[0] : null;
773773

774774
if (item !== undefined) {
775775
filetype = item.getAttribute("data-type");

0 commit comments

Comments
 (0)