autocomplete send form after uri handled
This commit is contained in:
parent
8b25b5932f
commit
8acaca75fb
6 changed files with 37 additions and 7 deletions
|
|
@ -71,7 +71,9 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
|
||||
$rootScope.$watch('txAlertCount', function(txAlertCount) {
|
||||
if (txAlertCount && txAlertCount > 0) {
|
||||
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : 'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
|
||||
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ?
|
||||
'You have a pending transaction proposal' :
|
||||
'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
return flag;
|
||||
};
|
||||
|
||||
if ($rootScope.pendingPayment) {
|
||||
var pp = $rootScope.pendingPayment;
|
||||
$scope.address = pp.address;
|
||||
var amount = pp.amount / config.unitToSatoshi * 100000000;
|
||||
$scope.amount = amount;
|
||||
}
|
||||
|
||||
// Detect protocol
|
||||
$scope.isHttp = ($window.location.protocol.indexOf('http') === 0);
|
||||
|
||||
|
|
@ -61,6 +68,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
$rootScope.pendingPayment = null;
|
||||
});
|
||||
|
||||
// reset fields
|
||||
|
|
@ -265,7 +273,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
};
|
||||
|
||||
$scope.topAmount = function(form) {
|
||||
$scope.amount = $scope.getAvailableAmount();
|
||||
$scope.amount = $scope.getAvailableAmount();
|
||||
form.amount.$pristine = false;
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ angular.module('copayApp.controllers').controller('SigninController',
|
|||
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
||||
$scope.openPassword = '';
|
||||
|
||||
if ($rootScope.pendingPayment) {
|
||||
notification.info('Login Required', 'Please open wallet to complete payment');
|
||||
}
|
||||
|
||||
$scope.open = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
notification.error('Error', 'Please enter the required fields');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('UriPaymentController', function($rootScope, $scope, $routeParams) {
|
||||
angular.module('copayApp.controllers').controller('UriPaymentController', function($rootScope, $scope, $routeParams, $timeout, $location) {
|
||||
var data = decodeURIComponent($routeParams.data);
|
||||
var splitDots = data.split(':');
|
||||
$scope.protocol = splitDots[0];
|
||||
|
|
@ -12,7 +12,19 @@ angular.module('copayApp.controllers').controller('UriPaymentController', functi
|
|||
function(key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value);
|
||||
});
|
||||
$scope.amount = parseInt(data.amount);
|
||||
$scope.amount = parseFloat(data.amount);
|
||||
$scope.message = data.message;
|
||||
|
||||
$rootScope.pendingPayment = {
|
||||
protocol: $scope.protocol,
|
||||
address: $scope.address,
|
||||
amount: $scope.amount,
|
||||
message: $scope.message
|
||||
};
|
||||
|
||||
$timeout(function() {
|
||||
$location.path('signin');
|
||||
}, 1000);
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue