Skip to content

Commit

Permalink
Add confirmation dialog when deleting a project (#1410)
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano authored Jul 24, 2024
1 parent 18d805b commit aadc148
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ export async function deleteProject(node: ProjectNode | undefined): Promise<any>
api = new AtelierAPI(vscode.Uri.parse(`isfs://${serverName}:${namespace}/`));
project = await pickProject(api);
}
if (project === undefined) {
if (project == undefined) {
return;
}

try {
// Ask the user for confirmation
const answer = await vscode.window.showWarningMessage(`Delete project '${project}'?`, { modal: true }, "Yes", "No");
if (answer != "Yes") return;
// Delete the project
await api.actionQuery("DELETE FROM %Studio.Project WHERE Name = ?", [project]);
} catch (error) {
Expand Down

0 comments on commit aadc148

Please sign in to comment.