Closed SDK modal install window on early error.
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Fri, 26 Jan 2018 08:55:13 +0000 (09:55 +0100)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Fri, 26 Jan 2018 08:55:13 +0000 (09:55 +0100)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
webapp/src/app/pages/sdks/sdk-management/sdk-management.component.ts

index 3bb107b..6e9b81b 100644 (file)
@@ -141,15 +141,20 @@ export class SdkManagementComponent implements OnInit {
 
       modal.result.then(res => {
         if (res === 'yes') {
-          // Request installation
-          this.sdkSvr.install(sdk).subscribe(r => { }, err => this.alert.error(err));
-
           const modalInstall = this.modalService.open(SdkInstallComponent, {
             size: 'lg',
             backdrop: 'static',
             container: 'nb-layout',
           });
           modalInstall.componentInstance.sdk = sdk;
+
+          // Request installation
+          this.sdkSvr.install(sdk).subscribe(
+            r => { },
+            err => {
+              modalInstall.dismiss('SDK install failure');
+              this.alert.error(err);
+            });
         }
       });