Fix History from URI. Fix paypro. Fix join
This commit is contained in:
parent
10cc7fdf53
commit
d46a53c404
5 changed files with 82 additions and 53 deletions
|
|
@ -13,37 +13,33 @@
|
||||||
|
|
||||||
<div class="card list">
|
<div class="card list">
|
||||||
|
|
||||||
<div class="row">
|
<label class="item item-input item-stacked-label no-border">
|
||||||
<div class="col">
|
<span class="input-label" translate>Your nickname</span>
|
||||||
<label class="item item-input item-stacked-label no-border">
|
<input type="text"
|
||||||
<span class="input-label" translate>Your nickname</span>
|
placeholder="{{'John'|translate}}"
|
||||||
<input type="text"
|
name="myName"
|
||||||
placeholder="{{'John'|translate}}"
|
ng-model="myName"
|
||||||
name="myName"
|
ng-required="true">
|
||||||
ng-model="myName"
|
</label>
|
||||||
ng-required="true">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<label class="item item-input item-stacked-label no-border">
|
||||||
<div class="col col-90">
|
<span class="input-label" translate>Wallet Invitation</span>
|
||||||
<label class="item item-input item-stacked-label no-border">
|
<div class="input-notification">
|
||||||
<span class="input-label" translate>Wallet Invitation</span>
|
<i class="icon ion-checkmark-circled balanced"
|
||||||
<i class="icon ion-checkmark-circled balanced" ng-show="joinForm.secret.$valid && !joinForm.secret.$pristine && secret"></i>
|
ng-show="!joinForm.secret.$invalid"></i>
|
||||||
<i class="icon ion-close-circled assertive" ng-show="joinForm.secret.$invalid && !joinForm.secret.$pristine && secret"></i>
|
<i class="icon ion-close-circled assertive"
|
||||||
<input id="secret"
|
ng-show="joinForm.secret.$invalid && secret"></i>
|
||||||
type="text"
|
|
||||||
placeholder="{{'Paste invitation here'|translate}}"
|
|
||||||
name="secret"
|
|
||||||
ng-model="secret"
|
|
||||||
wallet-secret required>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-center">
|
<div class="qr-scan-icon">
|
||||||
<qr-scanner class="qr-icon size-24" on-scan="join.onQrCodeScanned(data)"></qr-scanner>
|
<qr-scanner class="qr-icon size-24" on-scan="join.onQrCodeScanned(data)"></qr-scanner>
|
||||||
|
<input id="secret"
|
||||||
|
type="text"
|
||||||
|
placeholder="{{'Paste invitation here'|translate}}"
|
||||||
|
name="secret"
|
||||||
|
ng-model="secret"
|
||||||
|
wallet-secret required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
|
|
||||||
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
|
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable">
|
||||||
<span translate ng-show="!showAdv">Show advanced options</span>
|
<span translate ng-show="!showAdv">Show advanced options</span>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService) {
|
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService, $ionicHistory) {
|
||||||
|
|
||||||
var address = $stateParams.address;
|
var address = $stateParams.address;
|
||||||
|
|
||||||
|
|
@ -26,9 +26,10 @@ angular.module('copayApp.controllers').controller('addressbookViewController', f
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.sendTo = function() {
|
$scope.sendTo = function() {
|
||||||
$state.go('^.^.send');
|
$ionicHistory.clearHistory();
|
||||||
|
$state.go('tabs.send');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$state.go('.amount', {
|
$state.transitionTo('tabs.send.amount', {
|
||||||
toAddress: $scope.addressbookEntry.address,
|
toAddress: $scope.addressbookEntry.address,
|
||||||
toName: $scope.addressbookEntry.name,
|
toName: $scope.addressbookEntry.name,
|
||||||
toEmail: $scope.addressbookEntry.email
|
toEmail: $scope.addressbookEntry.email
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicHistory, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
||||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount'));
|
$ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount'));
|
||||||
$ionicNavBarDelegate.showBackButton(true);
|
|
||||||
|
|
||||||
var unitToSatoshi;
|
var unitToSatoshi;
|
||||||
var satToUnit;
|
var satToUnit;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, popupService) {
|
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, $ionicHistory, popupService) {
|
||||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Confirm'));
|
$ionicNavBarDelegate.title(gettextCatalog.getString('Confirm'));
|
||||||
var cachedTxp = {};
|
var cachedTxp = {};
|
||||||
var isChromeApp = platformInfo.isChromeApp;
|
var isChromeApp = platformInfo.isChromeApp;
|
||||||
|
|
@ -77,6 +77,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
|
if ($stateParams.paypro) {
|
||||||
|
return setFromPayPro($stateParams.paypro, function(err) {
|
||||||
|
if (err && !isChromeApp) {
|
||||||
|
showAlert(gettext('Could not fetch payment'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
// TODO (URL , etc)
|
// TODO (URL , etc)
|
||||||
if (!$stateParams.toAddress || !$stateParams.toAmount) {
|
if (!$stateParams.toAddress || !$stateParams.toAmount) {
|
||||||
$log.error('Bad params at amount')
|
$log.error('Bad params at amount')
|
||||||
|
|
@ -261,7 +268,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
if (err) return;
|
if (err) return;
|
||||||
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
||||||
if (err) return setSendError(err);
|
if (err) return setSendError(err);
|
||||||
$state.transitionTo('tabs.home');
|
$ionicHistory.clearHistory();
|
||||||
|
$state.go('tabs.home');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, bitcore) {
|
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore) {
|
||||||
|
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
|
|
@ -26,7 +26,11 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
||||||
// data extensions for Payment Protocol with non-backwards-compatible request
|
// data extensions for Payment Protocol with non-backwards-compatible request
|
||||||
if ((/^bitcoin:\?r=[\w+]/).exec(data)) {
|
if ((/^bitcoin:\?r=[\w+]/).exec(data)) {
|
||||||
data = decodeURIComponent(data.replace('bitcoin:?r=', ''));
|
data = decodeURIComponent(data.replace('bitcoin:?r=', ''));
|
||||||
$state.go('tabs.send.confirm', {paypro: data})
|
$state.go('tabs.send');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.confirm', {paypro: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,44 +45,65 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
||||||
|
|
||||||
var amount = parsed.amount ? parsed.amount : '';
|
var amount = parsed.amount ? parsed.amount : '';
|
||||||
|
|
||||||
if (parsed.r) {
|
$state.go('tabs.send');
|
||||||
$state.go('tabs.send.confirm', {paypro: parsed.r});
|
$timeout(function() {
|
||||||
} else {
|
if (parsed.r) {
|
||||||
if (amount) {
|
$state.transitionTo('tabs.send.confirm', {paypro: parsed.r});
|
||||||
$state.go('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message})
|
|
||||||
} else {
|
} else {
|
||||||
$state.go('tabs.send.amount', {toAddress: addr})
|
if (amount) {
|
||||||
|
$state.transitionTo('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message});
|
||||||
|
} else {
|
||||||
|
$state.transitionTo('tabs.send.amount', {toAddress: addr});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}, 100);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Plain URL
|
// Plain URL
|
||||||
} else if (/^https?:\/\//.test(data)) {
|
} else if (/^https?:\/\//.test(data)) {
|
||||||
return $state.go('tabs.send.confirm', {paypro: data})
|
$state.go('tabs.send');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.confirm', {paypro: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
|
|
||||||
// Plain Address
|
// Plain Address
|
||||||
} else if (bitcore.Address.isValid(data, 'livenet')) {
|
} else if (bitcore.Address.isValid(data, 'livenet')) {
|
||||||
return $state.go('tabs.send.amount', {toAddress: data})
|
$state.go('tabs.send');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.amount', {toAddress: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
} else if (bitcore.Address.isValid(data, 'testnet')) {
|
} else if (bitcore.Address.isValid(data, 'testnet')) {
|
||||||
return $state.go('tabs.send.amount', {toAddress: data})
|
$state.go('tabs.send');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.send.amount', {toAddress: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
|
|
||||||
// Protocol
|
// Protocol
|
||||||
} else if (data.indexOf($window.appConfig.name + '://glidera')==0) {
|
} else if (data.indexOf($window.appConfig.name + '://glidera')==0) {
|
||||||
return $state.go('uriglidera', {url: data})
|
return $state.go('uriglidera', {url: data});
|
||||||
} else if (data.indexOf($window.appConfig.name + '://coinbase')==0) {
|
} else if (data.indexOf($window.appConfig.name + '://coinbase')==0) {
|
||||||
return $state.go('uricoinbase', {url: data})
|
return $state.go('uricoinbase', {url: data});
|
||||||
|
|
||||||
// Join
|
// Join
|
||||||
} else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
} else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
||||||
return $state.go('tabs.add.join', {url: data})
|
$state.go('tabs.home');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.add.join', {url: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
|
|
||||||
// Old join
|
// Old join
|
||||||
} else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
} else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
||||||
return $state.go('tabs.add.join', {url: data})
|
$state.go('tabs.home');
|
||||||
|
$timeout(function() {
|
||||||
|
$state.transitionTo('tabs.add.join', {url: data});
|
||||||
|
}, 100);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue