Skip to content

Commit

Permalink
Merge pull request #420 from BalticAmadeus/398-delete-button-warning
Browse files Browse the repository at this point in the history
Add connection deletion confirmation.
  • Loading branch information
PauliusKu authored Oct 4, 2023
2 parents 5f64db3 + c610699 commit 5a4967d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,17 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand(
`${Constants.globalExtensionKey}.deleteConnection`,
(dbConnectionNode: DbConnectionNode) => {
dbConnectionNode.deleteConnection(context);
async (dbConnectionNode: DbConnectionNode) => {
const confirmation = await vscode.window.showWarningMessage(
`Are you sure you want to delete the connection "${dbConnectionNode.config.label}"?`,
{ modal: true },
'Yes',
'No'
);

if (confirmation === 'Yes') {
dbConnectionNode.deleteConnection(context);
}
}
)
);
Expand Down

0 comments on commit 5a4967d

Please sign in to comment.