This `if` statement could be moved inside the `done()` handler of `ProjectManager.refreshFileTree()`. That would avoid the duplicate call to `refreshFileTree()` on line 557.