From 05567fc1be62b8ec09364e50c6583f7b91aea951 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Tue, 8 Aug 2017 16:05:30 +0200
Subject: [PATCH] [fix] Login: continue login when error in login extensions
 [fix] ES subscription: continue login process when error in subscription load

---
 www/index.html                                      | 9 +++------
 www/js/services/wallet-services.js                  | 6 +++++-
 www/plugins/es/js/services/subscription-services.js | 4 ++++
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/www/index.html b/www/index.html
index ab1c2be5a..5d663eff9 100644
--- a/www/index.html
+++ b/www/index.html
@@ -26,14 +26,11 @@
 
 </head>
 </head>
-<body ng-app="cesium" id="cesium" ng-strict-di
-      window-exit-unauth
+<body ng-app="cesium" id="cesium" ng-strict-di="true" window-exit-unauth="true"
       ng-class="{'nobackdrop': $root.tour, 'expert-mode': $root.settings.expertMode}">
 <ion-nav-view>
-  <h3 style="text-align: center; margin-top: 44px;">
-    <b>Cesium</b>
-  </h3>
-  <h4 style="text-align: center; margin-top: 10px;">Chargement / Sobreprima / Loading...</h4>
+  <h3 style="text-align: center; padding-top: 25px; "><b>Cesium</b></h3>
+  <h4 style="text-align: center;">Chargement / Sobreprima / Loading...</h4>
 </ion-nav-view>
 
 <!-- build:js dist_js/vendor.js -->
diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js
index 3af70632e..9533b1963 100644
--- a/www/js/services/wallet-services.js
+++ b/www/js/services/wallet-services.js
@@ -146,7 +146,11 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se
               // Call extend api
               .then(function() {
                 if (needLogin) {
-                  return api.data.raisePromise.login(data);
+                  return api.data.raisePromise.login(data)
+                    .catch(function(err) {
+                      console.warn('Error during extension call [wallet.api.data.on.login]', err);
+                      // continue
+                    });
                 }
               });
           }
diff --git a/www/plugins/es/js/services/subscription-services.js b/www/plugins/es/js/services/subscription-services.js
index 078bf87f7..6cc769906 100644
--- a/www/plugins/es/js/services/subscription-services.js
+++ b/www/plugins/es/js/services/subscription-services.js
@@ -50,6 +50,10 @@ angular.module('cesium.es.subscription.services', ['cesium.platform', 'cesium.es
         data.subscriptions.count = res && res.hits && res.hits.total;
         console.debug('[ES] [subscription] Loaded count (' + data.subscriptions.count  + ')');
         deferred.resolve(data);
+      })
+      .catch(function(err) {
+        console.error('Error while counting subscription: ' + (err.message ? err.message : err));
+        deferred.resolve(data);
       });
 
     return deferred.promise;
-- 
GitLab