Skip to content

Commit

Permalink
change response signature
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Nov 27, 2024
1 parent 6672c10 commit e205956
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ export class DeleteWorkspaceItemCommand extends Command {

public async execute(workspaceTreeItem: WorkspaceTreeItem): Promise<void> {
const type = workspaceTreeItem.category && isPluginType(workspaceTreeItem.category) ? "plugin" : "client";
console.log('Type:', type);
const yesAnswer = vscode.l10n.t("Yes");
const yesAnswer: vscode.MessageItem = { title: vscode.l10n.t("Yes") };
const noAnswer: vscode.MessageItem = { title: vscode.l10n.t("No") };

const response = await vscode.window.showWarningMessage(
vscode.l10n.t("Do you want to delete this item?"),
yesAnswer,
vscode.l10n.t("No")
noAnswer
);

console.log('Response from showWarningMessage:', response);
if (response === yesAnswer) {
if (response?.title === yesAnswer.title) {
const result = await this.deleteItem(type, workspaceTreeItem);
console.log('Result from deleteItem:', result);
if (result) {
Expand Down

0 comments on commit e205956

Please sign in to comment.