diff --git a/Gruntfile.js b/Gruntfile.js index 3c2064c2c..65e831f8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -224,7 +224,15 @@ module.exports = function(grunt) { buildDir: './webkitbuilds', version: '0.16.0', macIcns: './resources/<%= pkg.name %>/mac/app.icns', - exeIco: './www/img/app/logo.ico' + exeIco: './www/img/app/logo.ico', + macPlist: { + 'CFBundleURLTypes': [ + { + 'CFBundleURLName' : 'URI Handler', + 'CFBundleURLSchemes' : ['bitcoin', '<%= pkg.name %>'] + } + ] + } }, src: ['./package.json', './www/**/*'] }, @@ -254,6 +262,7 @@ module.exports = function(grunt) { grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']); grunt.registerTask('macos', ['prod', 'nwjs', 'exec:macos']); + grunt.registerTask('macos-debug', ['default', 'nwjs']); grunt.registerTask('chrome', ['exec:chrome']); grunt.registerTask('wp', ['prod', 'exec:wp']); grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']); diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 4351b9369..3c8ac591d 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( var cachedTxp = {}; var isChromeApp = platformInfo.isChromeApp; var countDown = null; + $scope.isCordova = platformInfo.isCordova; $ionicConfig.views.swipeBackEnabled(false); $scope.$on("$ionicView.beforeEnter", function(event, data) { @@ -30,9 +31,6 @@ angular.module('copayApp.controllers').controller('confirmController', function( $log.error('Bad params at amount'); throw ('bad params'); } - $scope.isCordova = platformInfo.isCordova; - $scope.hasClick = platformInfo.hasClick; - $scope.data = {}; var config = configService.getSync().wallet; $scope.feeLevel = config.settings && config.settings.feeLevel ? config.settings.feeLevel : 'normal'; diff --git a/src/js/routes.js b/src/js/routes.js index 6903a097b..f9d36f2c9 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -902,7 +902,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr .run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $window, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService) { uxLanguage.init(); - openURLService.init(); $ionicPlatform.ready(function() { if (platformInfo.isCordova) { @@ -995,6 +994,11 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr scannerService.gentleInitialize(); $state.go('tabs.home'); } + + // After everything have been loaded, initialize handler URL + $timeout(function() { + openURLService.init(); + }, 1000); }); }); diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index 326fa4794..2db4832a7 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -40,7 +40,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat // data extensions for Payment Protocol with non-backwards-compatible request if ((/^bitcoin:\?r=[\w+]/).exec(data)) { data = decodeURIComponent(data.replace('bitcoin:?r=', '')); - $state.go('tabs.send').then(function() { + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}).then(function() { $state.transitionTo('tabs.send.confirm', {paypro: data}); }); return true; @@ -62,7 +62,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat handlePayPro(details); }); } else { - $state.go('tabs.send'); + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}); // Timeout is required to enable the "Back" button $timeout(function() { if (amount) { @@ -70,7 +70,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat } else { $state.transitionTo('tabs.send.amount', {toAddress: addr}); } - }); + }, 100); } return true; @@ -102,7 +102,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat var secret = getParameterByName('secret', data); var email = getParameterByName('email', data); var otp = getParameterByName('otp', data); - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.bitpayCardIntro', { secret: secret, email: email, @@ -113,14 +113,14 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat // Join } else if (data && data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.add.join', {url: data}); }); return true; // Old join } else if (data && data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { - $state.go('tabs.home').then(function() { + $state.go('tabs.home', {}, {'reload': true, 'notify': $state.current.name == 'tabs.home' ? false : true}).then(function() { $state.transitionTo('tabs.add.join', {url: data}); }); return true; @@ -136,7 +136,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat }; function goToAmountPage(toAddress) { - $state.go('tabs.send'); + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}); $timeout(function() { $state.transitionTo('tabs.send.amount', {toAddress: toAddress}); }, 100); @@ -150,7 +150,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat paypro: payProDetails }; scannerService.pausePreview(); - $state.go('tabs.send').then(function() { + $state.go('tabs.send', {}, {'reload': true, 'notify': $state.current.name == 'tabs.send' ? false : true}).then(function() { $timeout(function() { $state.transitionTo('tabs.send.confirm', stateParams); }); diff --git a/src/js/services/openURL.js b/src/js/services/openURL.js index 1eb6d1c8f..adc4c6f72 100644 --- a/src/js/services/openURL.js +++ b/src/js/services/openURL.js @@ -8,9 +8,10 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop // Stop it from caching the first view as one to return when the app opens $ionicHistory.nextViewOptions({ historyRoot: true, - disableBack: true, + disableBack: false, disableAnimation: true }); + var url = args.url; if (!url) { $log.error('No url provided'); diff --git a/www/views/confirm.html b/www/views/confirm.html index 94bea675c..6c8dd10ac 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -7,7 +7,7 @@ - +
@@ -79,13 +79,13 @@
Click to pay Slide to pay