mirror of https://github.com/BTCPrivate/copay.git
Fix Glidera connect if wallet testnet is active
This commit is contained in:
parent
0b3a524b60
commit
caeea865a4
|
@ -8,8 +8,9 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
};
|
};
|
||||||
|
|
||||||
this.submitOauthCode = function(code) {
|
this.submitOauthCode = function(code) {
|
||||||
var fc = profileService.focusedClient;
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var glideraTestnet = configService.getSync().glidera.testnet;
|
||||||
|
var network = glideraTestnet ? 'testnet' : 'livenet';
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
@ -22,7 +23,7 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
else if (data && data.access_token) {
|
else if (data && data.access_token) {
|
||||||
storageService.setGlideraToken(fc.credentials.network, data.access_token, function() {
|
storageService.setGlideraToken(network, data.access_token, function() {
|
||||||
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.controllers').controller('glideraUriController',
|
angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
function($scope, $stateParams, $timeout, profileService, glideraService, storageService, go) {
|
function($scope, $stateParams, $timeout, profileService, configService, glideraService, storageService, go) {
|
||||||
|
|
||||||
this.submitOauthCode = function(code) {
|
this.submitOauthCode = function(code) {
|
||||||
var fc = profileService.focusedClient;
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var glideraTestnet = configService.getSync().glidera.testnet;
|
||||||
|
var network = glideraTestnet ? 'testnet' : 'livenet';
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
@ -17,7 +18,7 @@ angular.module('copayApp.controllers').controller('glideraUriController',
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
else if (data && data.access_token) {
|
else if (data && data.access_token) {
|
||||||
storageService.setGlideraToken(fc.credentials.network, data.access_token, function() {
|
storageService.setGlideraToken(network, data.access_token, function() {
|
||||||
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
$scope.$emit('Local/GlideraUpdated', data.access_token);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
go.path('glidera');
|
go.path('glidera');
|
||||||
|
|
|
@ -925,11 +925,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
self.initGlidera = function(accessToken) {
|
self.initGlidera = function(accessToken) {
|
||||||
self.glideraEnabled = configService.getSync().glidera.enabled;
|
self.glideraEnabled = configService.getSync().glidera.enabled;
|
||||||
// self.glideraTestnet = configService.getSync().glidera.testnet;
|
self.glideraTestnet = configService.getSync().glidera.testnet;
|
||||||
// var network = self.glideraTestnet ? 'testnet' : 'livenet';
|
var network = self.glideraTestnet ? 'testnet' : 'livenet';
|
||||||
// Disabled for testnet
|
|
||||||
self.glideraTestnet = false;
|
|
||||||
var network = 'livenet';
|
|
||||||
|
|
||||||
self.glideraToken = null;
|
self.glideraToken = null;
|
||||||
self.glideraError = null;
|
self.glideraError = null;
|
||||||
|
|
|
@ -76,6 +76,11 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
||||||
} else {
|
} else {
|
||||||
configCache = lodash.clone(defaultConfig);
|
configCache = lodash.clone(defaultConfig);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Glidera
|
||||||
|
// Disabled for testnet
|
||||||
|
configCache.glidera.testnet = false;
|
||||||
|
|
||||||
$log.debug('Preferences read:', configCache)
|
$log.debug('Preferences read:', configCache)
|
||||||
return cb(err, configCache);
|
return cb(err, configCache);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue