- this.appMgrSvc.undeployXapp(app.xapp).subscribe(
- ( httpResponse: HttpResponse<Object>) => {
- // Answers 204/No content on success
- this.notificationService.success('App undeployed successfully!');
- this.dataSource.loadTable();
- },
- ( (her: HttpErrorResponse) => {
- // the error field should have an ErrorTransport object
- let msg = her.message;
- if (her.error && her.error.message) {
- msg = her.error.message;
- }
- this.notificationService.warn('App undeploy failed: ' + msg);
- })
- );
+ this.loadingDialogService.startLoading('Undeploying ' + app.xapp);
+ this.appMgrSvc.undeployXapp(this.instanceKey, app.xapp)
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
+ (httpResponse: HttpResponse<Object>) => {
+ // Answers 204/No content on success
+ this.notificationService.success('App undeployed successfully!');
+ this.dataSource.loadTable(this.instanceKey);
+ },
+ ((her: HttpErrorResponse) => {
+ // the error field should have an ErrorTransport object
+ let msg = her.message;
+ if (her.error && her.error.message) {
+ msg = her.error.message;
+ }
+ this.notificationService.warn('App undeploy failed: ' + msg);
+ })
+ );