diff --git a/src/js/controllers/coinbase.js b/src/js/controllers/coinbase.js index f5ab4368e..3e03cefd3 100644 --- a/src/js/controllers/coinbase.js +++ b/src/js/controllers/coinbase.js @@ -33,9 +33,6 @@ angular.module('copayApp.controllers').controller('coinbaseController', function this.openAuthenticateWindow = function() { var oauthUrl = this.getAuthenticateUrl(); - externalLinkService.open(oauthUrl); - /* - * Not working (NW bug) if (!isNW) { externalLinkService.open(oauthUrl); } else { @@ -44,18 +41,19 @@ angular.module('copayApp.controllers').controller('coinbaseController', function gui.Window.open(oauthUrl, { focus: true, position: 'center' - }, function(win) { - win.on('loaded', function() { - var title = win.title; - if (title.indexOf('Coinbase') == -1) { - $scope.code = title; - self.submitOauthCode(title); - win.close(); - } + }, function(new_win) { + new_win.on('loaded', function() { + var title = new_win.window.document.title; + $timeout(function() { + if (title.indexOf('Coinbase') == -1) { + $scope.code = title; + self.submitOauthCode($scope.code); + new_win.close(); + } + }, 100); }); }); } - */ } this.getAuthenticateUrl = function() { diff --git a/src/js/services/coinbaseService.js b/src/js/services/coinbaseService.js index 90e0c5622..2c83ccb98 100644 --- a/src/js/services/coinbaseService.js +++ b/src/js/services/coinbaseService.js @@ -61,7 +61,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $ + 'wallet:payment-methods:read'; // NW has a bug with Window Object - if (isCordova || isNW) { + if (isCordova) { credentials.REDIRECT_URI = coinbase.redirect_uri.mobile; } else { credentials.REDIRECT_URI = coinbase.redirect_uri.desktop;