diff --git a/intuita-webview/src/main/CodemodRuns.tsx b/intuita-webview/src/main/CodemodRuns.tsx index c3540b7b..1a4effb2 100644 --- a/intuita-webview/src/main/CodemodRuns.tsx +++ b/intuita-webview/src/main/CodemodRuns.tsx @@ -78,9 +78,7 @@ export const CodemodRuns = ( { event.preventDefault(); diff --git a/src/data/slice.ts b/src/data/slice.ts index 68bb4f5a..f860d6ec 100644 --- a/src/data/slice.ts +++ b/src/data/slice.ts @@ -161,6 +161,7 @@ const rootSlice = createSlice({ state.focusedExplorerNodes = {}; }, onStateCleared(state) { + console.log('HERE'); state.clearingInProgress = false; }, setCodemods(state, action: PayloadAction>) { diff --git a/src/extension.ts b/src/extension.ts index a3dcf5ee..3e467e0b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -879,15 +879,20 @@ export async function activate(context: vscode.ExtensionContext) { casesDirectoryUri, ); - const directoryNames = files.filter( - ([, fileType]) => fileType === vscode.FileType.Directory, - ); + const caseDirectoryUris = files + .filter( + ([, fileType]) => fileType === vscode.FileType.Directory, + ) + .map(([name]) => vscode.Uri.joinPath(casesDirectoryUri, name)); + + await fileService.deleteDirectories({ uris: caseDirectoryUris }); - messageBus.publish({ - kind: MessageKind.deleteDirectories, - uris: [], - }); + store.dispatch(actions.onStateCleared()); + }), + ); + context.subscriptions.push( + vscode.commands.registerCommand('intuita.stopStateClearing', () => { store.dispatch(actions.onStateCleared()); }), );