From 7e61c9b86e6e25afa32a2e3e0c6c8fcd24cc194c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 28 Mar 2018 10:38:49 +0200 Subject: [PATCH] comment listening 'add', 'addDir' --- src/services/sharedFolder.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/sharedFolder.js b/src/services/sharedFolder.js index 9965c4d1f7..49a330611f 100644 --- a/src/services/sharedFolder.js +++ b/src/services/sharedFolder.js @@ -99,16 +99,19 @@ module.exports = { setupNotifications: function (path) { if (!isRealPath(path)) return var watcher = chokidar.watch(path, {depth: 0, ignorePermissionErrors: true}) - console.log('setup ntifications for ' + path) + console.log('setup notifications for ' + path) + /* we can't listen on created file / folder watcher.on('add', (f, stat) => { isbinaryfile(f, (error, isBinary) => { if (error) console.log(error) + console.log('add', f) if (this.websocket.connection) this.websocket.send(message('created', { path: utils.relativePath(f, this.sharedFolder), isReadOnly: isBinary, isFolder: false })) }) }) watcher.on('addDir', (f, stat) => { if (this.websocket.connection) this.websocket.send(message('created', { path: utils.relativePath(f, this.sharedFolder), isReadOnly: false, isFolder: true })) }) + */ watcher.on('change', (f, curr, prev) => { if (this.trackDownStreamUpdate[f]) { delete this.trackDownStreamUpdate[f]