Safe readdir() use for pathMaps
This commit is contained in:
parent
a28955c011
commit
90d07c4ffa
2 changed files with 5 additions and 4 deletions
|
@ -100,6 +100,7 @@ define([
|
|||
}, done)
|
||||
},
|
||||
readdir: function(done) {
|
||||
if (!this.isDir) return done();
|
||||
//TODO: track entries, compare to existing, do not duplicate
|
||||
var self = this;
|
||||
var reader = this.entry.createReader();
|
||||
|
|
|
@ -36,10 +36,10 @@ define([
|
|||
//after initial render, do the walk for path lookup
|
||||
root.walk(function(node, c) {
|
||||
pathMap[node.entry.fullPath] = node;
|
||||
//make sure the children are read and populated
|
||||
node.readdir(function() {
|
||||
c();
|
||||
});
|
||||
//make sure the children are read and populated, then continue
|
||||
if (node.isDir) {
|
||||
node.readdir(c);
|
||||
} else c();
|
||||
});
|
||||
});
|
||||
setVisible();
|
||||
|
|
Loading…
Reference in a new issue