Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/filters-backup.js

Issue 29397638: Issue 5057 - Update adblockpluscore dependency to revision 3bdddf0e8343 (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created March 29, 2017, 2:21 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dependencies » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/filters-backup.js
===================================================================
--- a/chrome/content/ui/filters-backup.js
+++ b/chrome/content/ui/filters-backup.js
@@ -92,30 +92,32 @@ var Backup =
* Called when the Restore menu is being opened, fills in "Automated backup"
* entries.
*/
fillRestorePopup: function()
{
while (this.restoreInsertionPoint.nextSibling && !this.restoreInsertionPoint.nextSibling.id)
this.restoreInsertionPoint.parentNode.removeChild(this.restoreInsertionPoint.nextSibling);
- let files = FilterStorage.getBackupFiles().reverse();
- for (let i = 0; i < files.length; i++)
+ FilterStorage.getBackupFiles().then(backups =>
{
- let file = files[i];
- let item = this.restoreTemplate.cloneNode(true);
- let label = item.getAttribute("label");
- label = label.replace(/\?1\?/, Utils.formatTime(file.lastModifiedTime));
- item.setAttribute("label", label);
- item.addEventListener("command", function()
+ backups.reverse();
+ for (let backup of backups)
{
- Backup.restoreAllData(file);
- }, false);
- this.restoreInsertionPoint.parentNode.insertBefore(item, this.restoreInsertionPoint.nextSibling);
- }
+ let item = this.restoreTemplate.cloneNode(true);
+ let label = item.getAttribute("label");
+ label = label.replace(/\?1\?/, Utils.formatTime(backup.lastModified));
+ item.setAttribute("label", label);
+ item.addEventListener("command", function()
kzar 2017/03/30 05:45:51 Nit: Any reason not to use an arrow function here?
Wladimir Palant 2017/03/30 10:13:11 I'd rather not make unnecessary changes to this co
+ {
+ Backup.restoreAllData(backup.file);
+ }, false);
+ this.restoreInsertionPoint.parentNode.insertBefore(item, this.restoreInsertionPoint.nextSibling);
kzar 2017/03/30 05:45:51 Nit: Long line.
Wladimir Palant 2017/03/30 10:13:11 Same here, I'd rather not make unnecessary changes
+ }
+ });
},
/**
* Lets the user choose a file to restore filters from.
*/
restoreFromFile: function()
{
let picker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
« no previous file with comments | « no previous file | dependencies » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld