Skip to content

Commit

Permalink
Delete confirmation popup should show always (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrysteq authored Oct 21, 2021
1 parent 96ae662 commit 69e33b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DialogMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export namespace DialogMessage {
export const noServerConfig: string = localize('tomcatExt.noServerConfig', 'The Tomcat Server is broken. It does not have server.xml');
export const selectWarPackage: string = localize('tomcatExt.selectWarPackage', 'Select War Package');
export const selectDirectory: string = localize('tomcatExt.selectDirectory', 'Select Tomcat Directory');
export const deleteConfirm: string = localize('tomcatExt.deleteConfirm', 'This Tomcat Server is running, are you sure you want to delete it?');
export const deleteConfirm: string = localize('tomcatExt.deleteConfirm', 'Are you sure you want to delete this server?');
export const serverRunning: string = localize('tomcatExt.serverRunning', 'This Tomcat Server is already started.');
export const serverStopped: string = localize('tomcatExt.serverStopped', 'This Tomcat Server was stopped.');
export const startServer: string = localize('tomcatExt.startServer', 'The Tomcat server needs to be started before browsing. Would you like to start it now?');
Expand Down
10 changes: 5 additions & 5 deletions src/Tomcat/TomcatController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export class TomcatController {
public async deleteServer(operationId: string, tomcatServer: TomcatServer): Promise<void> {
const server: TomcatServer = await this.precheck(operationId, tomcatServer);
if (server) {
const confirmation: MessageItem = await vscode.window.showWarningMessage(DialogMessage.deleteConfirm, DialogMessage.yes, DialogMessage.cancel);
if (confirmation !== DialogMessage.yes) {
Utility.infoTelemetryStep(operationId, 'cancel');
return;
}
if (server.isStarted()) {
const confirmation: MessageItem = await vscode.window.showWarningMessage(DialogMessage.deleteConfirm, DialogMessage.yes, DialogMessage.cancel);
if (confirmation !== DialogMessage.yes) {
Utility.infoTelemetryStep(operationId, 'cancel');
return;
}
await this.stopOrRestartServer(operationId, server);
}
this._tomcatModel.deleteServer(server);
Expand Down

0 comments on commit 69e33b7

Please sign in to comment.