mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🐛 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:
@@ -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() })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user