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

Unified Diff: lib/init.js

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Updated implementation. Created June 2, 2017, 3:49 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 | « include/AdblockPlus/JsEngine.h ('k') | lib/prefs.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/init.js
===================================================================
--- a/lib/init.js
+++ b/lib/init.js
@@ -13,34 +13,35 @@
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
let {Prefs} = require("prefs");
let {FilterNotifier} = require("filterNotifier");
-let prefsInitDone = false;
let filtersInitDone = false;
function checkInitialized()
{
- if (prefsInitDone && filtersInitDone)
+ if (Prefs.initialized && filtersInitDone)
{
checkInitialized = function() {};
_triggerEvent("_init", require("filterStorage").FilterStorage.firstRun);
}
}
Prefs._initListener = function()
{
- prefsInitDone = true;
checkInitialized();
};
+if (Prefs.initialized)
+ checkInitialized();
hub 2017/06/02 16:04:16 This is to fix an ordering issue where this might
+
FilterNotifier.addListener(function(action)
{
if (action === "load")
{
let {FilterStorage} = require("filterStorage");
if (FilterStorage.firstRun)
{
// No data, must be a new user or someone with corrupted data - initialize
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | lib/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld