Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30793 from bevis-tseng/Bug_1167507
Browse files Browse the repository at this point in the history
Bug 1167507 - Wrap the input of the FDN Contact to MozIcc.updateContact() as a mozContact. r=evelyn
  • Loading branch information
evelynhung committed Jul 9, 2015
2 parents 260118e + 4c7e6ba commit d8e68a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions apps/settings/js/modules/fdn_context.js
Expand Up @@ -83,7 +83,7 @@ define(function() {
* @param {String} action
* @param {Number} options.cardIndex
* @param {Object} options.contact
* @return {Object}
* @return {mozContact}
*/
createAction: function(action, options) {
var simContact = {};
Expand All @@ -109,7 +109,13 @@ define(function() {
simContact.tel[0].value = '';
break;
}
return simContact;

var result = new window.mozContact(simContact);
if ('id' in simContact) {
result.id = simContact.id;
}

return result;
}
};

Expand Down
7 changes: 6 additions & 1 deletion tests/atoms/gaia_data_layer.js
Expand Up @@ -110,7 +110,12 @@ var GaiaDataLayer = {
var iccId = window.navigator.mozIccManager.iccIds[0];
var icc = window.navigator.mozIccManager.getIccById(iccId);

var req = icc.updateContact(aType, aContact);
var simContact = new window.mozContact(aContact);
if ('id' in aContact) {
simContact.id = aContact.id;
}

var req = icc.updateContact(aType, simContact);
req.onsuccess = function() {
console.log('success saving contact to SIM');
marionetteScriptFinished(req.result);
Expand Down

0 comments on commit d8e68a7

Please sign in to comment.