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

Unified Diff: lib/filterStorage.js

Issue 5689385303408640: Issue 216 - First run page opens on every update (Closed)
Patch Set: Created March 26, 2014, 12:35 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
===================================================================
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -361,16 +361,17 @@ let FilterStorage = exports.FilterStorag
* @param {nsIFile} [sourceFile] File to read from
*/
loadFromDisk: function(sourceFile)
{
if (this._loading)
return;
TimeLine.enter("Entered FilterStorage.loadFromDisk()");
+ this._loading = true;
let readFile = function(sourceFile, backupIndex)
{
TimeLine.enter("FilterStorage.loadFromDisk() -> readFile()");
let parser = new INIParser();
IO.readFromFile(sourceFile, true, parser, function(e)
{
@@ -446,44 +447,38 @@ let FilterStorage = exports.FilterStorag
FilterNotifier.triggerListeners("load");
if (sourceFile != this.sourceFile)
this.saveToDisk();
TimeLine.leave("FilterStorage.loadFromDisk() read callback done");
}.bind(this);
- let startRead = function(file)
- {
- this._loading = true;
- readFile(file, 0);
- }.bind(this);
-
let explicitFile;
if (sourceFile)
{
explicitFile = true;
- startRead(sourceFile);
+ readFile(sourceFile, 0);
}
else
{
explicitFile = false;
sourceFile = FilterStorage.sourceFile;
let callback = function(e, statData)
{
if (e || !statData.exists)
{
this.firstRun = true;
this._loading = false;
FilterNotifier.triggerListeners("load");
TimeLine.leave("FilterStorage.loadFromDisk() read callback done");
}
- startRead(sourceFile);
+ readFile(sourceFile, 0);
}
if (sourceFile)
IO.statFile(sourceFile, callback);
else
callback(true);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld