Fix resume event on mobile for Glidera/Coinbase integration (#4083)

This commit is contained in:
Gustavo Maximiliano Cortez 2016-04-15 15:29:20 -03:00 committed by Matias Alejo Garcia
commit 4a8e5397ce
4 changed files with 13 additions and 7 deletions

View file

@ -3,6 +3,8 @@
angular.module('copayApp.controllers').controller('coinbaseController',
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, coinbaseService, isChromeApp, animationService, lodash, nodeWebkit) {
window.ignoreMobilePause = true;
this.openAuthenticateWindow = function() {
var oauthUrl = this.getAuthenticateUrl();
if (!nodeWebkit.isDefined()) {

View file

@ -17,14 +17,16 @@ angular.module('copayApp.controllers').controller('coinbaseUriController',
$scope.$apply();
}, 100);
}
else if (data && data.access_token) {
else if (data && data.access_token && data.refresh_token) {
storageService.setCoinbaseToken(network, data.access_token, function() {
storageService.setCoinbaseRefreshToken(network, data.refresh_token, function() {
$scope.$emit('Local/CoinbaseUpdated', data.access_token);
$timeout(function() {
go.path('coinbase');
$scope.$apply();
}, 100);
});
});
}
});
}, 100);

View file

@ -3,6 +3,7 @@
angular.module('copayApp.controllers').controller('glideraController',
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService, lodash) {
window.ignoreMobilePause = true;
this.getAuthenticateUrl = function() {
return glideraService.getOauthCodeUrl();

View file

@ -356,7 +356,8 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
root.getPendingTransactions = function(cb) {
var network = configService.getSync().coinbase.testnet ? 'testnet' : 'livenet';
storageService.getCoinbaseTxs(network, function(err, txs) {
return cb(err, JSON.parse(txs));
var _txs = txs ? JSON.parse(txs) : {};
return cb(err, _txs);
});
};