diff --git a/www/plugins/es/js/services/wallet-services.js b/www/plugins/es/js/services/wallet-services.js index f2c61619fd7f44c3a588f0f2920245bcb9b84ba9..7d693886046a43189becb6f870e991f7f46a6cf4 100644 --- a/www/plugins/es/js/services/wallet-services.js +++ b/www/plugins/es/js/services/wallet-services.js @@ -33,6 +33,7 @@ angular.module('cesium.es.wallet.services', ['ngResource', 'cesium.wallet.servic } function packRecordFields(record, keypair, recipientFieldName, cypherFieldNames) { + recipientFieldName = recipientFieldName || 'recipient'; if (!record[recipientFieldName]) { return $q.reject({message:'ES_WALLET.ERROR.RECIPIENT_IS_MANDATORY'}); @@ -43,6 +44,9 @@ angular.module('cesium.es.wallet.services', ['ngResource', 'cesium.wallet.servic cypherFieldNames = [cypherFieldNames]; } + // Work on a copy, to keep the original record (as it could be use again - fix #382) + record = angular.copy(record); + // Get recipient var recipientPk = CryptoUtils.util.decode_base58(record[recipientFieldName]);