diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 4c31fd514..08967c530 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -61,11 +61,6 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.notAvailable = true; $log.warn('No wallet available to make the payment'); } - - $timeout(function() { - $scope.$apply(); - }); - return; } }); }); @@ -73,6 +68,10 @@ angular.module('copayApp.controllers').controller('confirmController', function( txFormatService.formatAlternativeStr(amount, function(v) { $scope.alternativeAmountStr = v; }); + + $timeout(function() { + $scope.$apply(); + }, 100); }; $scope.$on('accepted', function(event) { diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index 150b67509..8cc754689 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore) { +angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $ionicHistory, $state, $window, $timeout, bitcore) { var root = {}; @@ -87,13 +87,13 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni return true; // Protocol - } else if (data.indexOf($window.appConfig.name + '://glidera')==0) { + } else if (data && data.indexOf($window.appConfig.name + '://glidera')==0) { return $state.go('uriglidera', {url: data}); - } else if (data.indexOf($window.appConfig.name + '://coinbase')==0) { + } else if (data && data.indexOf($window.appConfig.name + '://coinbase')==0) { return $state.go('uricoinbase', {url: data}); // Join - } else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { + } else if (data && data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() { @@ -102,7 +102,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni return true; // Old join - } else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { + } else if (data && data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) { $ionicHistory.removeBackView(); $state.go('tabs.home'); $timeout(function() {