From f981de8e614f43974063eb4ffcc378281f934725 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 6 Jan 2017 13:10:42 +0000 Subject: [PATCH] Use editor.hasFile instead of storage.exists --- src/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 909f2d3619..68113642e3 100644 --- a/src/app.js +++ b/src/app.js @@ -209,7 +209,7 @@ var run = function () { var fileList = $('input.inputFile')[0].files for (var i = 0; i < fileList.length; i++) { var name = fileList[i].name - if (!storage.exists(utils.fileKey(name)) || confirm('The file ' + name + ' already exists! Would you like to overwrite it?')) { + if (!editor.hasFile(name) || confirm('The file ' + name + ' already exists! Would you like to overwrite it?')) { editor.uploadFile(fileList[i], updateFiles) } } @@ -241,7 +241,7 @@ var run = function () { $fileNameInputEl.off('keyup') if (newName !== originalName && confirm( - storage.exists(utils.fileKey(newName)) + editor.hasFile(newName) ? 'Are you sure you want to overwrite: ' + newName + ' with ' + originalName + '?' : 'Are you sure you want to rename: ' + originalName + ' to ' + newName + '?')) { storage.rename(utils.fileKey(originalName), utils.fileKey(newName))