🐛 Fix bug disposing watchers in Project::addPath

`this.rootDirectories` is an Array of Directory objects. `path` is a
String. Therefore, `this.rootDirectories.includes(path)` will always
evaluate to `false`. We instead need to look for an entry in
`this.rootDirectories` where the Directory object's path is equal to the
given path.
This commit is contained in:
Jason Rudolph
2017-10-15 09:59:41 -04:00
parent 5937b95b49
commit 5ec9d0f134

View File

@@ -347,7 +347,7 @@ class Project extends Model {
})
for (let path in this.watcherPromisesByPath) {
if (!this.rootDirectories.includes(path)) {
if (!this.rootDirectories.find(dir => dir.getPath() === path)) {
this.watcherPromisesByPath[path].then(watcher => { watcher.dispose() })
}
}