Set thirdParty on the sendflow
This commit is contained in:
parent
7a78eb1261
commit
621c60a2ce
3 changed files with 54 additions and 54 deletions
|
|
@ -30,7 +30,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
|||
vm.sendableFunds = '';
|
||||
vm.showSendMaxButton = false;
|
||||
vm.showSendLimitMaxButton = false;
|
||||
vm.thirdParty = false;
|
||||
vm.thirdParty = null;
|
||||
vm.unit = '';
|
||||
|
||||
// Functions
|
||||
|
|
@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
|||
sendFlowService.state.pop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
initCurrencies();
|
||||
|
||||
passthroughParams = sendFlowService.state.getClone();
|
||||
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
||||
|
||||
// Init thirdParty, should be done for all the variable
|
||||
vm.thirdParty = null;
|
||||
|
||||
vm.fromWalletId = passthroughParams.fromWalletId;
|
||||
vm.toWalletId = passthroughParams.toWalletId;
|
||||
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
||||
|
|
|
|||
|
|
@ -9,33 +9,6 @@ angular
|
|||
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
|
||||
var vm = this;
|
||||
|
||||
// Functions
|
||||
vm.goBack = goBack;
|
||||
vm.onSuccessConfirm = onSuccessConfirm;
|
||||
vm.onShareTransaction = onShareTransaction;
|
||||
|
||||
var sendFlowData;
|
||||
var config = null;
|
||||
var coin = '';
|
||||
var countDown = null;
|
||||
var defaults = {};
|
||||
var usingCustomFee = false;
|
||||
var usingMerchantFee = false;
|
||||
var destinationWalletId = '';
|
||||
var lastTxId = '';
|
||||
var originWalletId = '';
|
||||
var priceDisplayIsFiat = true;
|
||||
var satoshis = null;
|
||||
var toAddress = '';
|
||||
var tx = {};
|
||||
var txPayproData = null;
|
||||
var unitFromSat = 0;
|
||||
|
||||
var FEE_TOO_HIGH_LIMIT_PERCENTAGE = 15;
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
||||
|
||||
function initVariables() {
|
||||
vm.buttonText = '';
|
||||
vm.destination = {
|
||||
address: '',
|
||||
|
|
@ -79,13 +52,38 @@ angular
|
|||
vm.thirdParty = null;
|
||||
vm.wallet = null;
|
||||
vm.memoExpanded = false;
|
||||
}
|
||||
|
||||
// Functions
|
||||
vm.goBack = goBack;
|
||||
vm.onSuccessConfirm = onSuccessConfirm;
|
||||
vm.onShareTransaction = onShareTransaction;
|
||||
|
||||
var sendFlowData;
|
||||
var config = null;
|
||||
var coin = '';
|
||||
var countDown = null;
|
||||
var defaults = {};
|
||||
var usingCustomFee = false;
|
||||
var usingMerchantFee = false;
|
||||
var destinationWalletId = '';
|
||||
var lastTxId = '';
|
||||
var originWalletId = '';
|
||||
var priceDisplayIsFiat = true;
|
||||
var satoshis = null;
|
||||
var toAddress = '';
|
||||
var tx = {};
|
||||
var txPayproData = null;
|
||||
var unitFromSat = 0;
|
||||
|
||||
var FEE_TOO_HIGH_LIMIT_PERCENTAGE = 15;
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
||||
|
||||
function onBeforeEnter(event, data) {
|
||||
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
||||
|
||||
// Reset from last time
|
||||
initVariables();
|
||||
vm.thirdParty = null;
|
||||
|
||||
defaults = configService.getDefaults();
|
||||
sendFlowData = sendFlowService.state.getClone();
|
||||
|
|
|
|||
|
|
@ -52,9 +52,6 @@ angular
|
|||
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
||||
$scope.isPaymentRequest = true;
|
||||
}
|
||||
if ($scope.params.thirdParty) {
|
||||
$scope.thirdParty = $scope.params.thirdParty;
|
||||
}
|
||||
};
|
||||
|
||||
function onEnter (event, data) {
|
||||
|
|
@ -62,7 +59,7 @@ angular
|
|||
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
||||
});
|
||||
|
||||
if ($scope.thirdParty) {
|
||||
if ($scope.params.thirdParty) {
|
||||
// Third party services specific logic
|
||||
handleThirdPartyIfShapeshift();
|
||||
}
|
||||
|
|
@ -102,8 +99,8 @@ angular
|
|||
}
|
||||
|
||||
function handleThirdPartyIfShapeshift() {
|
||||
console.log($scope.thirdParty, $scope.coin);
|
||||
if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
||||
console.log($scope.params.thirdParty, $scope.coin);
|
||||
if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
||||
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
||||
if ($scope.coin === 'bch') {
|
||||
$scope.coin = 'btc';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue