Skip to content

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

non recursive directory watcher

Borislav Sapundzhievbd52c1dc483c
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index e703be9ce..016af5e7b 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -98,11 +98,6 @@ define(function(require, exports, module) {
// Saving the last opened location path in the settings
TSCORE.Config.setLastOpenedLocation(path);
TSCORE.Config.saveSettings();
- if (typeof TSCORE.IO.watchDirecotory === 'function') {
- TSCORE.IO.watchDirecotory(path, function(event, file) {
- TSCORE.IO.listDirectory(path);
- });
- }
}
// Clear search query
TSCORE.clearSearchFilter();
diff --git a/data/node-webkit/node-webkit.api.js b/data/node-webkit/node-webkit.api.js
index 327120509..a082beb8f 100644
--- a/data/node-webkit/node-webkit.api.js
+++ b/data/node-webkit/node-webkit.api.js
@@ -499,6 +499,10 @@ define(function(require, exports, module) {
}
}
TSPOSTIO.listDirectory(anotatedDirList);
+
+ watchDirecotory(dirPath, function(event, file) {
+ TSCORE.IO.listDirectory(dirPath);
+ });
});
} catch (ex) {
TSPOSTIO.errorOpeningPath();
@@ -628,7 +632,7 @@ define(function(require, exports, module) {
if (fsWatcher) {
fsWatcher.close();
}
- fsWatcher = fs.watch(dirPath, { persistent: true, recursive: true }, listener);
+ fsWatcher = fs.watch(dirPath, { persistent: true, recursive: false }, listener);
};
exports.createDirectory = createDirectory;
@@ -656,5 +660,4 @@ define(function(require, exports, module) {
exports.handleTray = handleTray;
exports.focusWindow = focusWindow;
exports.showMainWindow = showMainWindow;
- exports.watchDirecotory = watchDirecotory;
});