Ref
This commit is contained in:
parent
35476ce1ab
commit
e884b4e7d7
1 changed files with 4 additions and 13 deletions
|
|
@ -1019,21 +1019,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return newUri;
|
return newUri;
|
||||||
};
|
};
|
||||||
|
|
||||||
function backwardCompatible(uri) {
|
|
||||||
var regex = /^bitcoin:\?r=[\w+]/;
|
|
||||||
var match = regex.exec(uri);
|
|
||||||
if (!match || match.length === 0) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return decodeURIComponent(uri.replace('bitcoin:?r=', ''));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var backwardCompatibleUri = backwardCompatible(uri);
|
|
||||||
var satToUnit = 1 / this.unitToSatoshi;
|
var satToUnit = 1 / this.unitToSatoshi;
|
||||||
|
|
||||||
if (backwardCompatibleUri) {
|
// URI extensions for Payment Protocol with non-backwards-compatible request
|
||||||
this.setFromPayPro(backwardCompatibleUri, function(err) {
|
if ((/^bitcoin:\?r=[\w+]/).exec(uri)) {
|
||||||
|
uri = decodeURIComponent(uri.replace('bitcoin:?r=', ''));
|
||||||
|
this.setFromPayPro(uri, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue