mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1647359 - Preferences should only clone the parts of the search engine objects that it actually needs. r=jaws,preferences-reviewers
The clones appear to be so that access for the tree view in preferences is quick. However, they don't need to clone the entire engine object - they just need three fields. Additionally, this fixes reloading icons which was attempting to use 'uri' but that isn't defined, and so icons would fail to load if preferences was opened when a search engine is added. Differential Revision: https://phabricator.services.mozilla.com/D80496
This commit is contained in:
parent
cefccb3918
commit
39b66db125
@ -639,7 +639,7 @@ EngineStore.prototype = {
|
||||
|
||||
_cloneEngine(aEngine) {
|
||||
var clonedObj = {};
|
||||
for (var i in aEngine) {
|
||||
for (let i of ["name", "alias", "iconURI"]) {
|
||||
clonedObj[i] = aEngine[i];
|
||||
}
|
||||
clonedObj.originalEngine = aEngine;
|
||||
@ -738,7 +738,7 @@ EngineStore.prototype = {
|
||||
|
||||
reloadIcons() {
|
||||
this._engines.forEach(function(e) {
|
||||
e.uri = e.originalEngine.uri;
|
||||
e.iconURI = e.originalEngine.iconURI;
|
||||
});
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user