From b239a528bf4bfdb6cdc2bb83350086491da02a39 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 8 Jan 2021 16:51:34 +0100 Subject: [PATCH] Minor code improvement --- www/common/outer/async-store.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index b0b8d263e..343dda673 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2870,13 +2870,6 @@ define([ */ var initialized = false; - var whenReady = function (cb) { - if (store.returned) { return void cb(); } - setTimeout(function() { - whenReady(cb); - }, 100); - }; - Store.init = function (clientId, data, _callback) { var callback = Util.once(_callback); @@ -2899,7 +2892,7 @@ define([ type: "offline" }); } - return void whenReady(function () { + return void onReadyEvt.reg(function () { callback({ state: 'ALREADY_INIT', returned: store.returned