fix: workspace already opened (#6721)

This commit is contained in:
naman-bruno
2026-01-07 14:35:03 +05:30
committed by GitHub
parent c03fe301f8
commit 4d60425a05

View File

@@ -147,7 +147,7 @@ class WorkspaceWatcher {
}
const watcher = chokidar.watch(workspaceFilePath, {
ignoreInitial: false,
ignoreInitial: true,
persistent: true,
ignorePermissionErrors: true,
awaitWriteFinish: {
@@ -156,8 +156,11 @@ class WorkspaceWatcher {
}
});
// Only listen for 'change' events - 'add' event is not needed because:
// 1. The workspace is already loaded when the watcher is started
// 2. ignoreInitial: true prevents firing for existing files
// 3. If workspace.yml is deleted and recreated, 'change' will catch it
watcher.on('change', () => handleWorkspaceFileChange(win, workspacePath));
watcher.on('add', () => handleWorkspaceFileChange(win, workspacePath));
self.watchers[workspacePath] = watcher;