From edbae6f730fcd179733a49ad7480a92b73d29167 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 9 Sep 2015 00:02:12 -0300 Subject: [PATCH] Fix error when connection fail --- public/views/glidera.html | 28 +++++++++++++++++++++------- public/views/preferencesGlidera.html | 3 +-- src/js/controllers/glidera.js | 10 ++++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/public/views/glidera.html b/public/views/glidera.html index 3df1ee0fa..d1637afe9 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -28,16 +28,27 @@ -
+
- Could not connect to Glidera: Unauthorized - Could not connect to Glidera: Forbidden - {{index.glideraError || glidera.error}} + {{index.glideraError}}
-
-
+
+ +
+ +
@@ -67,6 +78,9 @@
+
+ {{glidera.error}} +
-
    +

      Account

    • diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index 8d66d9583..90cd7608f 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -13,6 +13,7 @@ angular.module('copayApp.controllers').controller('glideraController', var fc = profileService.focusedClient; var self = this; this.loading = true; + this.error = null; $timeout(function() { glideraService.getToken(code, function(err, data) { self.loading = null; @@ -72,4 +73,13 @@ angular.module('copayApp.controllers').controller('glideraController', }); }; + this.revokeToken = function() { + var fc = profileService.focusedClient; + storageService.removeGlideraToken(fc.credentials.network, function() { + $timeout(function() { + applicationService.restart(); + }, 100); + }); + }; + });