Merge pull request #363 from Bitcoin-com/wallet/task/546

546 - Fixes lost after the merge + fix send flow
This commit is contained in:
Jean-Baptiste Dominguez 2018-09-26 21:07:22 +02:00 committed by GitHub
commit b0283cee18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View file

@ -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);

View file

@ -79,9 +79,12 @@ angular
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
function onBeforeEnter(event, data) {
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
// Reset from last time
vm.thirdParty = null;
defaults = configService.getDefaults();
sendFlowData = sendFlowService.state.getClone();
originWalletId = sendFlowData.fromWalletId;

View file

@ -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';
@ -117,6 +114,8 @@ angular
var walletsAll = [];
var walletsSufficientFunds = [];
$scope.walletsInsufficientFunds = []; // For origin screen
$scope.walletsBtc = [];
$scope.walletsBch = [];
if ($scope.type === 'origin') {
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');