Skip to content

Commit

Permalink
fix: remove watcher on file delete
Browse files Browse the repository at this point in the history
  • Loading branch information
erdkse committed Oct 25, 2021
1 parent e13eb69 commit d6255a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/redux/services/kubeConfigMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export function monitorKubeConfig(filePath: string, dispatch: AppDispatch) {
ignoreInitial: true,
});

watcher.on('all', () => {
watcher.on('all', (type: string) => {
if (type === 'unlink') {
watcher.close();
dispatch(loadContexts(''));
return;
}
dispatch(loadContexts(filePath));
});

Expand Down

0 comments on commit d6255a7

Please sign in to comment.