prelim logic to conditionally display incoming data menu based on the source
This commit is contained in:
parent
890dadade0
commit
78c9ac2484
2 changed files with 32 additions and 21 deletions
|
|
@ -61,7 +61,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
|
|
||||||
$scope.openScanner = function() {
|
$scope.openScanner = function() {
|
||||||
$state.go('tabs.scan');
|
$state.go('tabs.scan');
|
||||||
}
|
};
|
||||||
|
|
||||||
$scope.showMore = function() {
|
$scope.showMore = function() {
|
||||||
currentContactsPage++;
|
currentContactsPage++;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
}
|
}
|
||||||
|
|
||||||
data = sanitizeUri(data);
|
data = sanitizeUri(data);
|
||||||
|
//data = 'msEVvmpiFEtXv3MdsFLUYMbnNLeNYrqBEA';
|
||||||
|
|
||||||
// BIP21
|
// BIP21
|
||||||
if (bitcore.URI.isValid(data)) {
|
if (bitcore.URI.isValid(data)) {
|
||||||
|
|
@ -90,30 +91,32 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
$state.transitionTo('tabs.send.confirm', stateParams);
|
$state.transitionTo('tabs.send.confirm', stateParams);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
// Plain Address
|
// Plain Address
|
||||||
} else if (bitcore.Address.isValid(data, 'livenet')) {
|
} else if (bitcore.Address.isValid(data, 'livenet')) {
|
||||||
root.showMenu({data: data, type: 'bitcoinAddress'});
|
//root.showMenu({data: data, type: 'bitcoinAddress'});
|
||||||
|
goToAmountPage(data);
|
||||||
} else if (bitcore.Address.isValid(data, 'testnet')) {
|
} else if (bitcore.Address.isValid(data, 'testnet')) {
|
||||||
root.showMenu({data: data, type: 'bitcoinAddress'});
|
//root.showMenu({data: data, type: 'bitcoinAddress'});
|
||||||
// Protocol
|
goToAmountPage(data);
|
||||||
} else if (data && data.indexOf($window.appConfig.name + '://glidera') === 0) {
|
// Protocol
|
||||||
return $state.go('uriglidera', {url: data});
|
} else if (data && data.indexOf($window.appConfig.name + '://glidera') === 0) {
|
||||||
|
return $state.go('uriglidera', {url: data});
|
||||||
} else if (data && data.indexOf($window.appConfig.name + '://coinbase') === 0) {
|
} else if (data && data.indexOf($window.appConfig.name + '://coinbase') === 0) {
|
||||||
return $state.go('uricoinbase', {url: data});
|
return $state.go('uricoinbase', {url: data});
|
||||||
|
|
||||||
// BitPayCard Authentication
|
// BitPayCard Authentication
|
||||||
} else if (data && data.indexOf($window.appConfig.name + '://') === 0) {
|
} else if (data && data.indexOf($window.appConfig.name + '://') === 0) {
|
||||||
var secret = getParameterByName('secret', data);
|
var secret = getParameterByName('secret', data);
|
||||||
var email = getParameterByName('email', data);
|
var email = getParameterByName('email', data);
|
||||||
var otp = getParameterByName('otp', data);
|
var otp = getParameterByName('otp', data);
|
||||||
$state.go('tabs.home').then(function() {
|
$state.go('tabs.home').then(function() {
|
||||||
$state.transitionTo('tabs.bitpayCardIntro', {
|
$state.transitionTo('tabs.bitpayCardIntro', {
|
||||||
secret: secret,
|
secret: secret,
|
||||||
email: email,
|
email: email,
|
||||||
otp: otp
|
otp: otp
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
return true;
|
||||||
return true;
|
|
||||||
|
|
||||||
// Join
|
// Join
|
||||||
} else if (data && 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}$/)) {
|
||||||
|
|
@ -173,5 +176,13 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goToAmountPage(toAddress) {
|
||||||
|
console.log('goToAmountPage called', toAddress);
|
||||||
|
$state.go('tabs.send');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.amount', {toAddress: toAddress});
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue