Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/accountstatus/accountstatus.es6
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
2 changes: 1 addition & 1 deletion src/websitestatus/websitestatus.es6
Original file line number Diff line number Diff line change
Expand Up @@ -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);
8 changes: 4 additions & 4 deletions src/websockets/binary_websockets.es6
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 };
Expand Down