don't use the store until it's ready to be used
This commit is contained in:
1 parent
fffa9acf15
commit
600f3151e9
6 files changed
+99
-32
No files matched your search
+9
-1
@@ -610,10 +610,18 @@ define([
|
||||
|
||||
var interval = 100;
|
||||
|
||||
var second = function (CM) {
|
||||
Cryptpad.ready(function (err, env) {
|
||||
// TODO handle error
|
||||
andThen(CM);
|
||||
});
|
||||
};
|
||||
|
||||
var first = function () {
|
||||
if (ifrw.CodeMirror) {
|
||||
// it exists, call your continuation
|
||||
andThen(ifrw.CodeMirror);
|
||||
//andThen(ifrw.CodeMirror);
|
||||
second(ifrw.CodeMirror);
|
||||
} else {
|
||||
console.log("CodeMirror was not defined. Trying again in %sms", interval);
|
||||
// try again in 'interval' ms
|
||||
|
||||
Reference in new issue
Block a user