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.sendableFunds = '';
|
||||||
vm.showSendMaxButton = false;
|
vm.showSendMaxButton = false;
|
||||||
vm.showSendLimitMaxButton = false;
|
vm.showSendLimitMaxButton = false;
|
||||||
vm.thirdParty = false;
|
vm.thirdParty = null;
|
||||||
vm.unit = '';
|
vm.unit = '';
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
||||||
sendFlowService.state.pop();
|
sendFlowService.state.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initCurrencies();
|
initCurrencies();
|
||||||
|
|
||||||
passthroughParams = sendFlowService.state.getClone();
|
passthroughParams = sendFlowService.state.getClone();
|
||||||
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
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.fromWalletId = passthroughParams.fromWalletId;
|
||||||
vm.toWalletId = passthroughParams.toWalletId;
|
vm.toWalletId = passthroughParams.toWalletId;
|
||||||
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,50 @@ 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) {
|
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;
|
var vm = this;
|
||||||
|
|
||||||
|
vm.buttonText = '';
|
||||||
|
vm.destination = {
|
||||||
|
address: '',
|
||||||
|
balanceAmount: '',
|
||||||
|
balanceCurrency: '',
|
||||||
|
coin: '',
|
||||||
|
color: '',
|
||||||
|
currency: '',
|
||||||
|
currencyColor: '',
|
||||||
|
kind: '', // 'address', 'contact', 'wallet'
|
||||||
|
name: ''
|
||||||
|
};
|
||||||
|
vm.displayAddress = '';
|
||||||
|
vm.feeCrypto = '';
|
||||||
|
vm.feeFiat = '';
|
||||||
|
vm.fiatCurrency = '';
|
||||||
|
vm.feeIsHigh = false;
|
||||||
|
vm.feeLessThanACent = false;
|
||||||
|
vm.isCordova = platformInfo.isCordova;
|
||||||
|
vm.memo = '';
|
||||||
|
vm.notReadyMessage = '';
|
||||||
|
vm.origin = {
|
||||||
|
balanceAmount: '',
|
||||||
|
balanceCurrency: '',
|
||||||
|
currency: '',
|
||||||
|
currencyColor: '',
|
||||||
|
};
|
||||||
|
vm.originWallet = null;
|
||||||
|
vm.paymentExpired = false;
|
||||||
|
vm.personalNotePlaceholder = gettextCatalog.getString('Enter text here');
|
||||||
|
vm.primaryAmount = '';
|
||||||
|
vm.primaryCurrency = '';
|
||||||
|
vm.usingMerchantFee = false;
|
||||||
|
vm.readyToSend = false;
|
||||||
|
vm.remainingTimeStr = '';
|
||||||
|
vm.secondaryAmount = '';
|
||||||
|
vm.secondaryCurrency = '';
|
||||||
|
vm.sendingTitle = gettextCatalog.getString('You are sending');
|
||||||
|
vm.sendStatus = '';
|
||||||
|
vm.showAddress = true;
|
||||||
|
vm.thirdParty = null;
|
||||||
|
vm.wallet = null;
|
||||||
|
vm.memoExpanded = false;
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
vm.goBack = goBack;
|
vm.goBack = goBack;
|
||||||
vm.onSuccessConfirm = onSuccessConfirm;
|
vm.onSuccessConfirm = onSuccessConfirm;
|
||||||
|
|
@ -35,57 +79,11 @@ angular
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
||||||
|
|
||||||
function initVariables() {
|
|
||||||
vm.buttonText = '';
|
|
||||||
vm.destination = {
|
|
||||||
address: '',
|
|
||||||
balanceAmount: '',
|
|
||||||
balanceCurrency: '',
|
|
||||||
coin: '',
|
|
||||||
color: '',
|
|
||||||
currency: '',
|
|
||||||
currencyColor: '',
|
|
||||||
kind: '', // 'address', 'contact', 'wallet'
|
|
||||||
name: ''
|
|
||||||
};
|
|
||||||
vm.displayAddress = '';
|
|
||||||
vm.feeCrypto = '';
|
|
||||||
vm.feeFiat = '';
|
|
||||||
vm.fiatCurrency = '';
|
|
||||||
vm.feeIsHigh = false;
|
|
||||||
vm.feeLessThanACent = false;
|
|
||||||
vm.isCordova = platformInfo.isCordova;
|
|
||||||
vm.memo = '';
|
|
||||||
vm.notReadyMessage = '';
|
|
||||||
vm.origin = {
|
|
||||||
balanceAmount: '',
|
|
||||||
balanceCurrency: '',
|
|
||||||
currency: '',
|
|
||||||
currencyColor: '',
|
|
||||||
};
|
|
||||||
vm.originWallet = null;
|
|
||||||
vm.paymentExpired = false;
|
|
||||||
vm.personalNotePlaceholder = gettextCatalog.getString('Enter text here');
|
|
||||||
vm.primaryAmount = '';
|
|
||||||
vm.primaryCurrency = '';
|
|
||||||
vm.usingMerchantFee = false;
|
|
||||||
vm.readyToSend = false;
|
|
||||||
vm.remainingTimeStr = '';
|
|
||||||
vm.secondaryAmount = '';
|
|
||||||
vm.secondaryCurrency = '';
|
|
||||||
vm.sendingTitle = gettextCatalog.getString('You are sending');
|
|
||||||
vm.sendStatus = '';
|
|
||||||
vm.showAddress = true;
|
|
||||||
vm.thirdParty = null;
|
|
||||||
vm.wallet = null;
|
|
||||||
vm.memoExpanded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onBeforeEnter(event, data) {
|
function onBeforeEnter(event, data) {
|
||||||
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
||||||
|
|
||||||
// Reset from last time
|
// Reset from last time
|
||||||
initVariables();
|
vm.thirdParty = null;
|
||||||
|
|
||||||
defaults = configService.getDefaults();
|
defaults = configService.getDefaults();
|
||||||
sendFlowData = sendFlowService.state.getClone();
|
sendFlowData = sendFlowService.state.getClone();
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,6 @@ angular
|
||||||
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
||||||
$scope.isPaymentRequest = true;
|
$scope.isPaymentRequest = true;
|
||||||
}
|
}
|
||||||
if ($scope.params.thirdParty) {
|
|
||||||
$scope.thirdParty = $scope.params.thirdParty;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function onEnter (event, data) {
|
function onEnter (event, data) {
|
||||||
|
|
@ -62,7 +59,7 @@ angular
|
||||||
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.thirdParty) {
|
if ($scope.params.thirdParty) {
|
||||||
// Third party services specific logic
|
// Third party services specific logic
|
||||||
handleThirdPartyIfShapeshift();
|
handleThirdPartyIfShapeshift();
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +99,8 @@ angular
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleThirdPartyIfShapeshift() {
|
function handleThirdPartyIfShapeshift() {
|
||||||
console.log($scope.thirdParty, $scope.coin);
|
console.log($scope.params.thirdParty, $scope.coin);
|
||||||
if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
||||||
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
||||||
if ($scope.coin === 'bch') {
|
if ($scope.coin === 'bch') {
|
||||||
$scope.coin = 'btc';
|
$scope.coin = 'btc';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue