do not start watcher on grandchildren

This commit is contained in:
nightwing 2017-03-07 17:49:32 +00:00
parent ad9413cbbb
commit 2efb2a7de0

View File

@ -414,7 +414,7 @@ define(function(require, exports, module) {
// watch children
var substr = id[id.length - 1] !== "/" ? id + "/" : id;
Object.keys(expandedList).forEach(function(path) {
if (path.lastIndexOf(substr, 0) === 0) {
if (path.startsWith(substr) && path.indexOf("/", substr.length) == -1) {
watcher.watch(path, refresh);
}
});