Fix handle URL (mobile). Replaces visa-api by api

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-10 11:12:26 -03:00
commit 252ebf45b3
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 20 additions and 9 deletions

View file

@ -1,9 +1,18 @@
'use strict';
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore) {
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore, lodash) {
var root = {};
var ignoreState = [
'tabs.language',
'tabs.about.translators',
'tabs.bitpayCardIntro',
'tabs.buyandsell.glidera',
'tabs.giftcards.amazon',
'tabs.giftcards.amazon.buy'
];
root.redir = function(data) {
$log.debug('Processing incoming data:' +data);
@ -70,7 +79,8 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
// Plain URL
} else if (/^https?:\/\//.test(data)) {
if ($state.current.name == 'tabs.bitpayCardIntro' || $state.current.name == 'tabs.buyandsell.glidera') return false;
var currentState = $state.current.name;
if (lodash.indexOf(ignoreState, currentState) != -1) return false;
$state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.confirm', {paypro: data});