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

Unified Diff: lib/init.js

Issue 29467599: Noissue - Fix some execution order issues in the prefs initialisation (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created June 16, 2017, 5:29 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 | 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();
+
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 | « no previous file | lib/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld