shapeshift flow

This commit is contained in:
Sebastiaan Pasma 2018-08-02 15:42:35 +02:00
commit aacc80ea21
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
10 changed files with 31 additions and 12 deletions

View file

@ -506,8 +506,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
}
}
$state.transitionTo('tabs.send.review', confirmData);
}
$state.transitionTo('tabs.send.review', confirmData);
$scope.useSendMax = null;
}
};

View file

@ -6,7 +6,7 @@ angular
function reviewController(addressbookService, configService, profileService, $log, $scope, txFormatService) {
var vm = this;
vm.destination = {
address: '',
balanceAmount: '',
@ -32,6 +32,7 @@ function reviewController(addressbookService, configService, profileService, $lo
vm.primaryCurrency = '';
vm.secondaryAmount = '';
vm.secondaryCurrency = '';
vm.thirdParty = false;
var config = null;
var coin = '';
@ -57,6 +58,20 @@ function reviewController(addressbookService, configService, profileService, $lo
vm.origin.name = originWallet.name;
coin = originWallet.coin;
if (data.stateParams.thirdParty) {
vm.thirdParty = JSON.parse(data.stateParams.thirdParty); // Parse stringified JSON-object
if (vm.thirdParty) {
if (vm.thirdParty.id === 'shapeshift') {
if (!vm.thirdParty.data) {
vm.thirdParty.data = {};
}
vm.thirdParty.data['fromWalletId'] = vm.fromWalletId;
vm.fromWallet = profileService.getWallet(vm.fromWalletId);
vm.toWallet = profileService.getWallet(vm.toWalletId);
}
}
}
configService.get(function onConfig(err, configCache) {
if (err) {
$log.err('Error getting config.', err);

View file

@ -345,7 +345,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
.state('tabs.send.review', {
url: '/review/:amount/:fromWalletId/:sendMax/:toAddr/:toWalletId',
url: '/review/:thirdParty/:amount/:fromWalletId/:sendMax/:toAddr/:toWalletId',
views: {
'tab-send@tabs': {
controller: 'reviewController',

View file

@ -254,6 +254,9 @@
padding: 0 6px 6px 6px;
text-align: center;
}
&__max {
float: right;
}
}
.send-amount-tool {

View file

@ -15,4 +15,7 @@
border: 0px;
@include button-shadow();
}
}
.header.shapeshift {
background: #243F5D;
}