sendflow service integrated into flow

This commit is contained in:
Sebastiaan Pasma 2018-08-08 17:10:47 +02:00
commit f7ecdb2f2f
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
7 changed files with 73 additions and 60 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('incomingData', function($log, $state, $timeout, $ionicHistory, bitcore, bitcoreCash, $rootScope, payproService, scannerService, appConfigService, popupService, gettextCatalog, bitcoinCashJsService) {
angular.module('copayApp.services').factory('incomingData', function($log, $state, $timeout, $ionicHistory, bitcore, bitcoreCash, $rootScope, payproService, scannerService, sendFlowService, appConfigService, popupService, gettextCatalog, bitcoinCashJsService) {
var root = {};
@ -105,9 +105,10 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
params.thirdParty = [];
params.thirdParty.id = serviceId;
params.thirdParty.data = serviceData;
params.thirdParty = JSON.stringify(params.thirdParty);
sendFlowService.map(params);
$state.transitionTo('tabs.send.amount', params);
} else {
sendFlowService.map(params);
$state.transitionTo('tabs.send.origin', params);
}
}, 100);
@ -458,6 +459,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
'notify': $state.current.name == 'tabs.send' ? false : true
}).then(function() {
$timeout(function() {
sendFlowService.map(stateParams);
$state.transitionTo('tabs.send.origin', stateParams);
});
});

View file

@ -20,5 +20,12 @@ angular.module('copayApp.services').factory('sendFlowService', function ($log) {
vm.toWalletId = false;
};
vm.map = function(params) {
Object.keys(params).map(function(key, index) {
vm[key] = params[key];
});
console.log(vm);
};
return vm;
});