diff --git a/public/views/glidera.html b/public/views/glidera.html
index 7d86e7c75..50a0de4ac 100644
--- a/public/views/glidera.html
+++ b/public/views/glidera.html
@@ -17,13 +17,30 @@
- Linking to Glidera...
+ Connecting to Glidera...
{{index.glideraLoading|translate}}
-
-

+
+
+
+

+
+
+
+
+ Could not connect to Glidera: Unauthorized
+ Could not connect to Glidera: Forbidden
+ {{index.glideraError || glidera.error}}
+
+
+
+
+
+
-
Paste the authorization code here
-
-
-
-
- Could not connect with Glidera: Unauthorized
- Could not connect with Glidera: Forbidden
- {{index.glideraError}}
-
-
-
-
-
+
diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js
index 979b1bf6a..63ac06939 100644
--- a/src/js/controllers/buyGlidera.js
+++ b/src/js/controllers/buyGlidera.js
@@ -65,7 +65,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
glideraService.buy(token, twoFaCode, data, function(err, data) {
self.loading = null;
if (err) {
- self.error = gettext('Could not buy bitcoin');
+ self.error = err;
}
else {
self.success = data;
diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js
index 40902df89..0c63b6ef3 100644
--- a/src/js/controllers/glidera.js
+++ b/src/js/controllers/glidera.js
@@ -9,17 +9,23 @@ angular.module('copayApp.controllers').controller('glideraController',
return glideraService.getOauthCodeUrl();
};
- this.submitOauthCode = function(code, glideraCredentials) {
+ this.submitOauthCode = function(code) {
var fc = profileService.focusedClient;
var self = this;
this.loading = true;
$timeout(function() {
- glideraService.getToken(code, glideraCredentials, function(error, data) {
- if (data && data.access_token) {
+ glideraService.getToken(code, function(err, data) {
+ self.loading = null;
+ if (err) {
+ self.error = err;
+ $timeout(function() {
+ $scope.$apply();
+ }, 100);
+ }
+ else if (data && data.access_token) {
storageService.setGlideraToken(fc.credentials.network, data.access_token, function() {
$scope.$emit('Local/GlideraTokenUpdated', data.access_token);
$timeout(function() {
- self.loading = null;
$scope.$apply();
}, 100);
});
diff --git a/src/js/controllers/sellGlidera.js b/src/js/controllers/sellGlidera.js
index 782379194..1b525c981 100644
--- a/src/js/controllers/sellGlidera.js
+++ b/src/js/controllers/sellGlidera.js
@@ -112,7 +112,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
glideraService.sell(token, twoFaCode, data, function(err, data) {
self.loading = null;
if (err) {
- self.error = gettext('Could not sell bitcoin');
+ self.error = err;
fc.removeTxProposal(txp, function(err, txpb) {
$timeout(function() {
$scope.$emit('Local/GlideraError');
diff --git a/src/js/services/glideraService.js b/src/js/services/glideraService.js
index 05ba9fbc7..653c1291c 100644
--- a/src/js/services/glideraService.js
+++ b/src/js/services/glideraService.js
@@ -50,7 +50,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Authorization Access Token: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Authorization Access Token: ERROR ' + data.statusText);
});
};
@@ -73,7 +73,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Access Token Permissions: ERROR ' + data.statusText);
- return cb('Glidera Access Token Permissions: ERROR');
+ return cb('Glidera Access Token Permissions: ERROR ' + data.statusText);
});
};
@@ -84,7 +84,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Get Email: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Get Email: ERROR ' + data.statusText);
});
};
@@ -95,7 +95,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Get Personal Info: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Get Personal Info: ERROR ' + data.statusText);
});
};
@@ -106,7 +106,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera User Status: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera User Status: ERROR ' + data.statusText);
});
};
@@ -117,7 +117,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Transaction Limits: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Transaction Limits: ERROR ' + data.statusText);
});
};
@@ -128,7 +128,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data.transactions);
}, function(data) {
$log.error('Glidera Transactions: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Transactions: ERROR ' + data.statusText);
});
};
@@ -140,7 +140,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Transaction: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Transaction: ERROR ' + data.statusText);
});
};
@@ -151,7 +151,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data.sellAddress);
}, function(data) {
$log.error('Glidera Create Sell Address: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Create Sell Address: ERROR ' + data.statusText);
});
};
@@ -162,7 +162,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.status == 200 ? true : false);
}, function(data) {
$log.error('Glidera Sent 2FA code by SMS: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Sent 2FA code by SMS: ERROR ' + data.statusText);
});
};
@@ -190,7 +190,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Sell Price: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Sell Price: ERROR ' + data.statusText);
});
};
@@ -206,8 +206,8 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
$log.info('Glidera Sell: SUCCESS');
return cb(null, data.data);
}, function(data) {
- $log.error('Glidera Sell: ERROR ' + data.statusText);
- return cb(data.statusText);
+ $log.error('Glidera Sell Request: ERROR ' + data.statusText);
+ return cb('Glidera Sell Request: ERROR ' + data.statusText);
});
};
@@ -221,7 +221,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
return cb(null, data.data);
}, function(data) {
$log.error('Glidera Buy Price: ERROR ' + data.statusText);
- return cb(data.statusText);
+ return cb('Glidera Buy Price: ERROR ' + data.statusText);
});
};
@@ -237,8 +237,8 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
$log.info('Glidera Buy: SUCCESS');
return cb(null, data.data);
}, function(data) {
- $log.error('Glidera Buy: ERROR ' + data.statusText);
- return cb(data.statusText);
+ $log.error('Glidera Buy Request: ERROR ' + data.statusText);
+ return cb('Glidera Buy Request: ERROR ' + data.statusText);
});
};