TagSpaces is an offline, open source, document manager with tagging support
correcting handling of unsupported functionality in chrome
uggrockd2ab9774dc81
diff --git a/data/chromium/chrome.api.js b/data/chromium/chrome.api.jsindex 1854943d0..788bcbe4b 100644--- a/data/chromium/chrome.api.js+++ b/data/chromium/chrome.api.js@@ -199,43 +199,37 @@ define(function(require, exports, module) {function createDirectoryPromise(dirPath) {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Creating directory is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Creating directory is not supported in Chrome, please use the desktop version.");});}function renameDirectoryPromise() {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Renaming directory is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Renaming directory is not supported in Chrome, please use the desktop version.");});}function renameFilePromise() {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Renaming file is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Renaming file is not supported in Chrome, please use the desktop version.");});}function copyFilePromise() {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Copy file is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Copy file is not supported in Chrome, please use the desktop version.");});}function deleteFilePromise() {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Creating directory is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Creating directory is not supported in Chrome, please use the desktop version.");});}function deleteDirectoryPromise() {return new Promise(function(res, rej) {- TSCORE.showAlertDialog("Deleting directory is not supported in Chrome, please use the desktop version.");- res(true);+ rej("Deleting directory is not supported in Chrome, please use the desktop version.");});}diff --git a/data/js/directories.ui.js b/data/js/directories.ui.jsindex 0b723db53..acb56874e 100644--- a/data/js/directories.ui.js+++ b/data/js/directories.ui.js@@ -677,14 +677,17 @@ define(function(require, exports, module) {$('body').append(uiTemplate());$('#createNewDirectoryButton').on('click', function() {// TODO validate folder name- //TSCORE.IO.createDirectory($('#createNewDirectoryButton').attr('path') + TSCORE.dirSeparator + $('#newDirectoryName').val());var dirPath = $('#createNewDirectoryButton').attr('path') + TSCORE.dirSeparator + $('#newDirectoryName').val();TSCORE.IO.createDirectoryPromise(dirPath).then(function() {TSPOSTIO.createDirectory(dirPath);}, function(error) {TSCORE.hideLoadingAnimation();console.error("Creating directory " + dirPath + " failed" + error);- TSCORE.showAlertDialog("Creating " + dirPath + " failed.");+ if(error) {+ TSCORE.showAlertDialog(error);+ } else {+ TSCORE.showAlertDialog("Creating " + dirPath + " failed.");+ }});});}