Skip to content

Commit

Permalink
FIXED: check for errors when watching paths, fixes #148 (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
warpdesign authored Jun 3, 2020
1 parent 05ddaba commit 6f4f086
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/services/plugins/FsLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,13 @@ export class LocalApi implements FsApi {
onList(dir: string) {
if (dir !== this.path) {
// console.log('stopWatching', this.path);
LocalWatch.stopWatchingPath(this.path, this.onFsChange);
try {
LocalWatch.stopWatchingPath(this.path, this.onFsChange);
LocalWatch.watchPath(dir, this.onFsChange);
} catch(e) {
console.warn('Could not watch path', dir, e);
}
// console.log('watchPath', dir);
LocalWatch.watchPath(dir, this.onFsChange);
this.path = dir;
}
}
Expand Down

0 comments on commit 6f4f086

Please sign in to comment.