Bug 1352325 - [Form Autofill] Sort manage profiles dialog by last modified time. r=lchang
MozReview-Commit-ID: 8WVLs04aDCm
--- a/browser/extensions/formautofill/content/manageProfiles.js
+++ b/browser/extensions/formautofill/content/manageProfiles.js
@@ -59,16 +59,18 @@ ManageProfileDialog.prototype = {
/**
* Load profiles and render them.
*
* @returns {promise}
*/
loadProfiles() {
return this.getProfiles().then(profiles => {
log.debug("profiles:", profiles);
+ // Sort by last modified time starting with most recent
+ profiles.sort((a, b) => b.timeLastModified - a.timeLastModified);
this.renderProfileElements(profiles);
this.updateButtonsStates(this._selectedOptions.length);
});
},
/**
* Get profiles from storage.
*