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);
};
var todo = function () {
storeToUse.ready(function (err, store) {
common.store = env.store = store;
if (USE_FS_STORE) {
@ -741,6 +742,13 @@ define([
});
}, 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 = [];
common.onError = function (h) {