Skip to content

TagSpaces is an offline, open source, document manager with tagging support

TS84 - fixed folder location

Borislav Sapundzhiev5e58f8384436
diff --git a/data/cordova/cordova.api.js b/data/cordova/cordova.api.js
index e9f1bb4cb..b7a77d70f 100644
--- a/data/cordova/cordova.api.js
+++ b/data/cordova/cordova.api.js
@@ -222,7 +222,10 @@ define(function(require, exports, module) {
var listSubDirectories = function(dirPath) {
console.log("Listing sub directories of: " + dirPath);
// directory path format DCIM/Camera/ !
- dirPath = dirPath + "/"; // TODO make it platform independent
+ if (dirPath.lastIndexOf("/") === 0 || dirPath.lastIndexOf("/") != dirPath.length - 1) {
+ dirPath = dirPath + "/"; // TODO make it platform independent
+ }
+
dirPath = normalizePath(dirPath);
console.log("Listing sub directories of : " + dirPath + " normalized.");
TSCORE.showLoadingAnimation();