Fix race condition with the iframe store

This commit is contained in:
yflory 2017-02-07 18:47:10 +01:00
parent 4aaaa2f647
commit 1e2cc6bea4

View File

@ -696,6 +696,7 @@ define([
f(void 0, env); f(void 0, env);
}; };
var todo = function () {
storeToUse.ready(function (err, store) { storeToUse.ready(function (err, store) {
common.store = env.store = store; common.store = env.store = store;
if (USE_FS_STORE) { if (USE_FS_STORE) {
@ -741,6 +742,13 @@ define([
}); });
}, common); }, common);
}; };
// If we use the fs store, make sure the localStorage or iframe store is ready
if (USE_FS_STORE) {
Store.ready(todo);
return;
}
todo();
};
var errorHandlers = []; var errorHandlers = [];
common.onError = function (h) { common.onError = function (h) {