diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 482eec17e1..66dc70a60b 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -63,7 +63,7 @@ class AccountStatus { // Getting account status, website status, account settings and financial assessment. return Promise.all([ liveapi.send({ get_account_status: 1 }), - liveapi.send({ 'website_status': 1 }), + liveapi.cached.send({ website_status: 1 }), liveapi.send({ 'get_settings': 1 }), liveapi.cached.send({ get_financial_assessment: 1 }), liveapi.send({ mt5_login_list: 1 }) diff --git a/src/websitestatus/websitestatus.es6 b/src/websitestatus/websitestatus.es6 index 1859d8ecf2..c38e54ee9f 100644 --- a/src/websitestatus/websitestatus.es6 +++ b/src/websitestatus/websitestatus.es6 @@ -32,4 +32,4 @@ const set_currency_config = (website_status) => { }; liveapi.events.on('website_status', website_status); -liveapi.cached.send({ website_status: 1, subscribe: 1 }).then(website_status); +liveapi.cached.send({ website_status: 1 }).then(website_status); \ No newline at end of file diff --git a/src/websockets/binary_websockets.es6 b/src/websockets/binary_websockets.es6 index 2c58ff44d3..2fbc7dc802 100644 --- a/src/websockets/binary_websockets.es6 +++ b/src/websockets/binary_websockets.es6 @@ -100,7 +100,7 @@ const onopen = () => { /** * First thing to do -> subscribe to website_status */ - socket.send(JSON.stringify({website_status:1, subscribe:1})); + socket.send(JSON.stringify({ website_status: 1, subscribe: 1 })); /* send buffered sends */ while (buffered_sends.length > 0) { const data = buffered_sends.shift(); @@ -427,9 +427,9 @@ export const cached = { const key = JSON.stringify(data); /* if there is a cached promise for this key (let say P), return P. * assume P is in pending state, when P is fullfiled all attached .then() calls will run. - * assume P is in rejected state (or in fullfiled state), the changed .then() calls will be immediately rejected(or fullfiled). */ - if (cached_promises[key]) - return cached_promises[key].promise; + * assume P is in rejected state (or in fullfiled state), the changed .then() calls will be immediately rejected(or fullfiled). */ + if (cached_promises[key]) + return cached_promises[key].promise; /* We don't want to cache promises that are rejected, Clear the cache in case of promise rejection */ cached_promises[key] = { data: data, promise: null };