add shapeshift order id to memo and fix display min amount bug
This commit is contained in:
parent
c4be7c991a
commit
4e8b587975
3 changed files with 17 additions and 10 deletions
|
|
@ -30,7 +30,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
$scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount);
|
$scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount);
|
||||||
$scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount);
|
$scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount);
|
||||||
$scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId;
|
$scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId;
|
||||||
console.log($scope.shapeshiftOrderId);
|
//console.log($scope.shapeshiftOrderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = configService.getSync().wallet.settings;
|
var config = configService.getSync().wallet.settings;
|
||||||
|
|
@ -320,9 +320,8 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
var formatedValue = format($scope.amount);
|
var formatedValue = format($scope.amount);
|
||||||
var result = evaluate(formatedValue);
|
var result = evaluate(formatedValue);
|
||||||
$scope.allowSend = lodash.isNumber(result) && +result > 0
|
$scope.allowSend = lodash.isNumber(result) && +result > 0
|
||||||
&& ((!$scope.minShapeshiftAmount && !$scope.maxShapeshiftAmount)
|
&& (!$scope.shapeshiftOrderId
|
||||||
|| ($scope.minShapeshiftAmount && $scope.maxShapeshiftAmount
|
|| (result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount));
|
||||||
&& result >= $scope.minShapeshiftAmount && result <= $scope.maxShapeshiftAmount));
|
|
||||||
|
|
||||||
if (lodash.isNumber(result)) {
|
if (lodash.isNumber(result)) {
|
||||||
$scope.globalResult = isExpression($scope.amount) ? '= ' + processResult(result) : '';
|
$scope.globalResult = isExpression($scope.amount) ? '= ' + processResult(result) : '';
|
||||||
|
|
@ -409,7 +408,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
amount = (amount * unitToSatoshi).toFixed(0);
|
amount = (amount * unitToSatoshi).toFixed(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$state.transitionTo('tabs.send.confirm', {
|
var confirmData = {
|
||||||
recipientType: $scope.recipientType,
|
recipientType: $scope.recipientType,
|
||||||
toAmount: amount,
|
toAmount: amount,
|
||||||
toAddress: $scope.toAddress,
|
toAddress: $scope.toAddress,
|
||||||
|
|
@ -417,8 +416,16 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
toEmail: $scope.toEmail,
|
toEmail: $scope.toEmail,
|
||||||
toColor: $scope.toColor,
|
toColor: $scope.toColor,
|
||||||
coin: coin,
|
coin: coin,
|
||||||
useSendMax: $scope.useSendMax
|
useSendMax: $scope.useSendMax,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if ($scope.shapeshiftOrderId) {
|
||||||
|
var shapeshiftOrderUrl = 'https://www.shapeshift.io/#/status/';
|
||||||
|
shapeshiftOrderUrl += $scope.shapeshiftOrderId;
|
||||||
|
confirmData.description = shapeshiftOrderUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
$state.transitionTo('tabs.send.confirm', confirmData);
|
||||||
}
|
}
|
||||||
$scope.useSendMax = null;
|
$scope.useSendMax = null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,8 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.depositInfo = txData;
|
$scope.depositInfo = txData;
|
||||||
console.log($scope.marketData);
|
//console.log($scope.marketData);
|
||||||
console.log($scope.depositInfo);
|
//console.log($scope.depositInfo);
|
||||||
var sendAddress = txData.depositQR;
|
var sendAddress = txData.depositQR;
|
||||||
if (sendAddress && sendAddress.indexOf('bitcoin cash') >= 0)
|
if (sendAddress && sendAddress.indexOf('bitcoin cash') >= 0)
|
||||||
sendAddress = sendAddress.replace('bitcoin cash', 'bitcoincash');
|
sendAddress = sendAddress.replace('bitcoin cash', 'bitcoincash');
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-if="minShapeshiftAmount && maxShapeshiftAmount">
|
<div ng-if="shapeshiftOrderId">
|
||||||
Minimum amount: {{minShapeshiftAmount}} <br/>
|
Minimum amount: {{minShapeshiftAmount}} <br/>
|
||||||
Maximum amount: {{maxShapeshiftAmount}}
|
Maximum amount: {{maxShapeshiftAmount}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue