Skip to content
Snippets Groups Projects
Commit 94fb860e authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

- do a copy before encrypt a message, to be able to resue it for outbox - fix #382

parent 1da17630
No related branches found
No related tags found
No related merge requests found
......@@ -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]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment