shapeshift orderid and back button
This commit is contained in:
parent
42c2b53953
commit
c4be7c991a
5 changed files with 22 additions and 5 deletions
|
|
@ -26,9 +26,11 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
|
||||
if (data.stateParams.minShapeshiftAmount.length > 0 && data.stateParams.maxShapeshiftAmount.length > 0) {
|
||||
if (data.stateParams.shapeshiftOrderId.length > 0) {
|
||||
$scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount);
|
||||
$scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount);
|
||||
$scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId;
|
||||
console.log($scope.shapeshiftOrderId);
|
||||
}
|
||||
|
||||
var config = configService.getSync().wallet.settings;
|
||||
|
|
@ -174,6 +176,19 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
}, 10);
|
||||
});
|
||||
|
||||
$scope.goBack = function() {
|
||||
if ($scope.shapeshiftOrderId) {
|
||||
$state.go('tabs.send').then(function() {
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.home').then(function() {
|
||||
$state.transitionTo('tabs.shapeshift');
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$ionicHistory.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
function paste(value) {
|
||||
$scope.amount = value;
|
||||
processAmount();
|
||||
|
|
@ -304,7 +319,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
function processAmount() {
|
||||
var formatedValue = format($scope.amount);
|
||||
var result = evaluate(formatedValue);
|
||||
$scope.allowSend = lodash.isNumber(result) && +result > 0
|
||||
$scope.allowSend = lodash.isNumber(result) && +result > 0
|
||||
&& ((!$scope.minShapeshiftAmount && !$scope.maxShapeshiftAmount)
|
||||
|| ($scope.minShapeshiftAmount && $scope.maxShapeshiftAmount
|
||||
&& result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount));
|
||||
|
|
|
|||
|
|
@ -100,7 +100,8 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
|
|||
|
||||
var shapeshiftData = {
|
||||
minAmount: $scope.marketData.minimum,
|
||||
maxAmount: $scope.marketData.maxLimit
|
||||
maxAmount: $scope.marketData.maxLimit,
|
||||
orderId: $scope.depositInfo.orderId
|
||||
};
|
||||
|
||||
if (incomingData.redir(sendAddress, shapeshiftData)) {
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
*/
|
||||
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:minShapeshiftAmount/:maxShapeshiftAmount',
|
||||
url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:minShapeshiftAmount/:maxShapeshiftAmount/:shapeshiftOrderId',
|
||||
views: {
|
||||
'tab-send@tabs': {
|
||||
controller: 'amountController',
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
if (shapeshiftData) {
|
||||
params['minShapeshiftAmount'] = shapeshiftData.minAmount;
|
||||
params['maxShapeshiftAmount'] = shapeshiftData.maxAmount;
|
||||
params['shapeshiftOrderId'] = shapeshiftData.orderId;
|
||||
}
|
||||
$state.transitionTo('tabs.send.amount', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<ion-nav-title>
|
||||
{{'Enter amount' | translate}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
<ion-nav-back-button ng-click="goBack()">
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-buttons side="secondary">
|
||||
<button class="button back-button" ng-click="showSendMaxMenu()" ng-if="showMenu">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue