diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 68d2745d2..fce8b58e6 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1129,13 +1129,22 @@ define([ }; - common.ready = function (f) { - var block = 0; + common.ready = (function () { var env = {}; + var initialized = false; + + return function (f) { + if (initialized) { + return void window.setTimeout(function () { + f(void 0, env); + }); + } + var block = 0; var cb = function () { block--; if (!block) { + initialized = true; f(void 0, env); } }; @@ -1229,6 +1238,8 @@ define([ }, common); }; + }()); + $(function () { Messages._applyTranslation(); });