Skip to content

Commit bf2f2e6

Browse files
authored
Always prompt for confirmation when deleting from ObjectScript Explorer (#1176)
1 parent 8fed401 commit bf2f2e6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/commands/delete.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,21 @@ export async function deleteExplorerItems(nodes: NodeBase[]): Promise<any> {
4242
)
4343
)
4444
.then(async (items) => {
45-
if (nodes.length > 1) {
46-
// Ask the user to confirm if they're deleting more than one explorer node
45+
if (items.length) {
46+
// Ask the user to confirm
4747
const confirm = await vscode.window.showWarningMessage(
48-
`About to delete ${items.length} document${items.length > 1 ? "s" : ""}. Are you sure you want to proceed?`,
48+
`About to delete ${
49+
items.length > 1 ? `${items.length} documents` : `'${items[0]}'`
50+
}. Are you sure you want to proceed?`,
4951
"Cancel",
5052
"Confirm"
5153
);
5254
if (confirm !== "Confirm") {
5355
// Don't delete without confirmation
5456
return;
5557
}
58+
deleteList(items, workspaceFolder, namespace);
59+
explorerProvider.refresh();
5660
}
57-
deleteList(items, workspaceFolder, namespace);
58-
explorerProvider.refresh();
5961
});
6062
}

0 commit comments

Comments
 (0)