don't use the store until it's ready to be used

This commit is contained in:
ansuz
2016-08-02 12:11:40 +02:00
parent fffa9acf15
commit 600f3151e9
6 changed files with 99 additions and 32 deletions

View File

@@ -623,11 +623,19 @@ define([
};
var interval = 100;
var second = function (Ckeditor) {
Cryptpad.ready(function (err, env) {
// TODO handle error
andThen(Ckeditor);
});
};
var first = function () {
Ckeditor = ifrw.CKEDITOR;
if (Ckeditor) {
andThen(Ckeditor);
//andThen(Ckeditor);
second(Ckeditor);
} else {
console.log("Ckeditor was not defined. Trying again in %sms",interval);
setTimeout(first, interval);