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 |