From b751a4f497cef85f11da66959b3d5c638fe9d714 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 29 Apr 2019 13:40:09 +0800 Subject: [PATCH 1/8] change send to cached send --- src/accountstatus/accountstatus.es6 | 6 +++--- src/cashier/deposit.es6 | 6 +++--- src/cashier/uk_funds_protection.es6 | 2 +- src/cashier/withdraw.es6 | 13 ++++++------- src/charts/chartingRequestMap.es6 | 2 +- src/copytrade/copytrade.es6 | 8 ++++++-- src/instruments/instruments.es6 | 1 + src/password/password.es6 | 2 +- src/portfolio/portfolio.es6 | 12 ++++++------ src/profittable/profitTable.es6 | 2 +- src/realitycheck/realitycheck.es6 | 1 + src/selfexclusion/selfexclusion.es6 | 3 ++- src/statement/statement.es6 | 4 +++- src/tc/tc.es6 | 2 +- src/token/token.es6 | 6 +++--- src/trade/tradeConf.es6 | 2 +- src/trade/tradeDialog.es6 | 10 +++++----- src/trade/tradeMenu.es6 | 1 + src/viewtransaction/viewTransaction.es6 | 6 +++--- src/windows/tracker.es6 | 1 + src/windows/windows.es6 | 1 + 21 files changed, 51 insertions(+), 40 deletions(-) diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 66dc70a60b..98c9c0043b 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -62,11 +62,11 @@ class AccountStatus { getStatus() { // Getting account status, website status, account settings and financial assessment. return Promise.all([ - liveapi.send({ get_account_status: 1 }), + liveapi.cached.send({ get_account_status: 1 }), liveapi.cached.send({ website_status: 1 }), - liveapi.send({ 'get_settings': 1 }), + liveapi.cached.send({ 'get_settings': 1 }), liveapi.cached.send({ get_financial_assessment: 1 }), - liveapi.send({ mt5_login_list: 1 }) + liveapi.cached.send({ mt5_login_list: 1 }) ]); } diff --git a/src/cashier/deposit.es6 b/src/cashier/deposit.es6 index 47991f0843..4bbed14378 100644 --- a/src/cashier/deposit.es6 +++ b/src/cashier/deposit.es6 @@ -136,7 +136,7 @@ function init_state(root) { deposit_win_view = rv.bind(root[0], state); /* get the cashier_url */ - liveapi.send({ + liveapi.cached.send({ cashier: 'deposit' }).then(function(data) { state.user.cashier_url = data.cashier; @@ -154,7 +154,7 @@ function init_state(root) { }); /* get the residence field and its states */ - var residence_promise = liveapi.send({ get_settings: 1 }) + var residence_promise = liveapi.cached.send({ get_settings: 1 }) .then(function(data) { state.user.residence = data.get_settings.country_code; state.user.residence_name = data.get_settings.country; @@ -165,7 +165,7 @@ function init_state(root) { residence_promise.then(function() { if (!state.user.residence) return { paymentagent_list: { list: [] } }; - return liveapi.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); + return liveapi.cached.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); }).then((data) => { const pa_list = data.paymentagent_list.list .map((agent) => { diff --git a/src/cashier/uk_funds_protection.es6 b/src/cashier/uk_funds_protection.es6 index 64c022c78d..7ec4beed3c 100644 --- a/src/cashier/uk_funds_protection.es6 +++ b/src/cashier/uk_funds_protection.es6 @@ -22,7 +22,7 @@ export const init_win = () => new Promise((resolve, reject) => { }); const state = {}; state.accept = () => { - liveapi.send({ + liveapi.cached.send({ "tnc_approval": 1, "ukgc_funds_protection": 1 }).then(resolve,reject).then(()=>{ diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 9e5300a757..c10557883d 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -177,7 +177,7 @@ class Withdraw { } agent.hint = `Min: ${agent.min_amount} Max: ${agent.max_amount}`.i18n(); - liveapi.send({ + liveapi.cached.send({ verify_email: email, type: type }) @@ -205,7 +205,7 @@ class Withdraw { if (menu.choice === 'standard') { verify.disabled = true; - liveapi.send({ + liveapi.cached.send({ cashier: 'withdraw', verification_code: verify.token }) @@ -283,7 +283,7 @@ class Withdraw { verification_code: verify.code }; agent.disabled = true; - liveapi.send(request) + liveapi.cached.send(request) .then(data => { route.update('agent-done') agent.disabled = false; @@ -297,7 +297,6 @@ class Withdraw { transfer.submit = () => { if (transfer.account === '' || transfer.amount === '') { - console.log(transfer); empty_fields.show(); return; } @@ -309,7 +308,7 @@ class Withdraw { amount: transfer.amount }; transfer.disabled = true; - liveapi.send(req) + liveapi.cached.send(req) .then(data => { transfer.account = transfer.account.split("_to_")[1]; route.update('transfer-done'); @@ -344,7 +343,7 @@ class Withdraw { } } - liveapi.send({ get_settings: 1 }) + liveapi.cached.send({ get_settings: 1 }) .then(data => { agent.residence = data.get_settings.country_code; const currency = local_storage.get('currency'); @@ -355,7 +354,7 @@ class Withdraw { }) .catch(error_handler); - liveapi.send({ payout_currencies: 1 }) + liveapi.cached.send({ payout_currencies: 1 }) .then(data => { agent.currency = data.payout_currencies[0]; }).catch(err => console.error(err)); diff --git a/src/charts/chartingRequestMap.es6 b/src/charts/chartingRequestMap.es6 index 68e6375b0f..9291879001 100644 --- a/src/charts/chartingRequestMap.es6 +++ b/src/charts/chartingRequestMap.es6 @@ -95,7 +95,7 @@ export const register = function(options) { map[key] = { symbol: options.symbol, granularity: granularity, subscribers: 0, chartIDs: [] }; if (req.subscribe) map[key].subscribers = 1; // how many charts have subscribed for a stream - return liveapi.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout + return liveapi.cached.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout .catch((up) => { /* if the market is closed try the same request without subscribing */ if (req.subscribe && up.code === 'MarketIsClosed') { diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 39a060223e..9469446a5c 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -87,6 +87,7 @@ instrumentPromise().then(instruments => { const refreshTraderStats = (loginid, token, scope) => { return new Promise((resolve, reject) => { liveapi + .cached .send({ copytrading_statistics: 1, trader_id: loginid, @@ -134,6 +135,7 @@ const state = { state.is_loading = true; liveapi + .cached .send({ set_settings: 1, allow_copiers, @@ -174,6 +176,7 @@ const state = { if (!settingsToSend.trade_types || settingsToSend.trade_types.length <= 0) delete settingsToSend.trade_types; liveapi + .cached .send(settingsToSend) .then(() => { newObj.disableStart = false; @@ -192,7 +195,7 @@ const state = { } } else { //Stop copying - liveapi.send({ + liveapi.cached.send({ copy_stop: state.traderTokens[index].yourCopySettings.copy_start }) .then(() => { @@ -211,7 +214,7 @@ const state = { const toBeRemovedItem = state.traderTokens[index]; state.traderTokens.splice(index, 1); updateLocalStorage(state); - liveapi.send({ + liveapi.cached.send({ copy_stop: toBeRemovedItem.yourCopySettings.copy_start }) .catch(e => {}); @@ -331,6 +334,7 @@ const initConfigWindow = () => { state.allowCopy.allow_copiers = 0; } else { liveapi + .cached .send({ get_settings: 1 }) .then((settings) => { state.is_loading = false; diff --git a/src/instruments/instruments.es6 b/src/instruments/instruments.es6 index 12ee7193b1..087d47a47a 100755 --- a/src/instruments/instruments.es6 +++ b/src/instruments/instruments.es6 @@ -8,6 +8,7 @@ import "common/util"; function refresh_active_symbols() { liveapi + .cached .send({ active_symbols: 'brief' }) .then(function(data) { local_storage.set('active_symbols', data.active_symbols); diff --git a/src/password/password.es6 b/src/password/password.es6 index f689841c5d..e3f026193e 100644 --- a/src/password/password.es6 +++ b/src/password/password.es6 @@ -95,7 +95,7 @@ const init_state = (root) => { new_password: state.account.new_password }; state.btn.disabled = true; - liveapi.send(request) + liveapi.cached.send(request) .then((data) =>{ if(data.change_password !== 1){ throw { message: 'Failed to update the password'.i18n()}; diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index fe09660288..a9d0cb3a46 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -63,7 +63,7 @@ const proposalOpenContract = (command) => { if(command === 'subscribe') { ++subscribers; if(!subscribed_before && subscribers > 0) { - liveapi.send({ proposal_open_contract: 1,subscribe: 1 }) + liveapi.cached.send({ proposal_open_contract: 1,subscribe: 1 }) .then((data) => { subscribed_before = true; }) .catch((err) => { console.error(err); @@ -74,7 +74,7 @@ const proposalOpenContract = (command) => { else if(command === 'forget') { --subscribers; if(subscribed_before && subscribers === 0) { - liveapi.send({ forget_all: 'proposal_open_contract' }) + liveapi.cached.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; }) @@ -85,7 +85,7 @@ const proposalOpenContract = (command) => { } } else if( command === 'resubscribe' ) { - liveapi.send({ forget_all: 'proposal_open_contract' }) + liveapi.cached.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; --subscribers; @@ -157,7 +157,7 @@ const initPortfolioWin = () => { } }); - liveapi.send({ balance: 1 }) + liveapi.cached.send({ balance: 1 }) .then((data) => { currency = data.balance.currency; portfolioWin = windows.createBlankWindow($('
'), { @@ -183,7 +183,7 @@ const initPortfolioWin = () => { liveapi.events.off('transaction', on_transaction); }, refresh: () => { - liveapi.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); + liveapi.cached.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); forget_the_contracts(subscribed_contracts).then(init_table); } }); @@ -262,7 +262,7 @@ const forget_the_contracts = (contracts) => { const init_table = async () => { const processing_msg = $('#' + table.attr('id') + '_processing').show(); try { - const data = await liveapi.send({ portfolio: 1 }); + const data = await liveapi.cached.send({ portfolio: 1 }); const contracts = (data.portfolio && data.portfolio.contracts); //|| [ // { diff --git a/src/profittable/profitTable.es6 b/src/profittable/profitTable.es6 index 2e0133ff8b..517f6e1484 100644 --- a/src/profittable/profitTable.es6 +++ b/src/profittable/profitTable.es6 @@ -91,7 +91,7 @@ const refreshTable = (yyyy_mm_dd) => { processing_msg.hide(); }; - liveapi.send(request) + liveapi.cached.send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/realitycheck/realitycheck.es6 b/src/realitycheck/realitycheck.es6 index 1ab6496392..dbd2a0b916 100644 --- a/src/realitycheck/realitycheck.es6 +++ b/src/realitycheck/realitycheck.es6 @@ -67,6 +67,7 @@ const setOrRefreshTimer = (timeOutInMins) => { const logoutAfter_ms = timeOutInMins * 60 * 1000; timerHandler = setTimeout(() => { liveapi + .cached .send({ reality_check : 1 }) .then((data) => { /* diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index f240462498..d96c3db7a9 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -167,7 +167,7 @@ const settingsData = { } } - liveapi.send(data) + liveapi.cached.send(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); @@ -235,6 +235,7 @@ function logoutBasedOnExcludeDateAndTimeOut() { const refreshData = function() { $.growl.notice({ message: 'Loading self-exclusion settings.'.i18n() }); return liveapi + .cached .send({ get_self_exclusion: 1 }) .then(function(response) { if (response.get_self_exclusion) { diff --git a/src/statement/statement.es6 b/src/statement/statement.es6 index 3ae934b8f5..1283fe87cd 100644 --- a/src/statement/statement.es6 +++ b/src/statement/statement.es6 @@ -84,7 +84,9 @@ const refreshTable = (yyy_mm_dd) => { if(!loading) { loading = true; - liveapi.send(request) + liveapi + .cached + .send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/tc/tc.es6 b/src/tc/tc.es6 index 053ac60a83..bdb207be05 100644 --- a/src/tc/tc.es6 +++ b/src/tc/tc.es6 @@ -27,7 +27,7 @@ export const init = () => { const div = $(html).i18n(); div.find('.tc_landing_comp_name').html(landing_company_name); div.find('.button').click(() => { - liveapi.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message + liveapi.cached.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message win.dialog('destroy'); }); win = windows.createBlankWindow($('
'), { diff --git a/src/token/token.es6 b/src/token/token.es6 index bb8104197b..73ee59d4be 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -96,7 +96,7 @@ const init_state = (root) => { state.confirm.yes = () => { const token = state.confirm.token; state.confirm.visible = false; - liveapi.send({ api_token: 1, delete_token: token.token }) + liveapi.cached.send({ api_token: 1, delete_token: token.token }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); @@ -152,7 +152,7 @@ const init_state = (root) => { } state.token.btn_disabled = true; - liveapi.send(request).then((data) => { + liveapi.cached.send(request).then((data) => { state.token.name = ''; state.token.btn_disabled = false; $.growl.notice({ message: `${'Successfully added new token '.i18n()} ${request.new_token}` }); @@ -170,7 +170,7 @@ const init_state = (root) => { } token_win_view = rv.bind(root[0], state); - return liveapi.send({ api_token: 1 }) + return liveapi.cached.send({ api_token: 1 }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeConf.es6 b/src/trade/tradeConf.es6 index 6a100f466b..a4b98f4807 100644 --- a/src/trade/tradeConf.es6 +++ b/src/trade/tradeConf.es6 @@ -258,7 +258,7 @@ const registerTicks = (state, extra) => { }); function getTickHistory(start, ticks_history) { - liveapi.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) + liveapi.cached.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) .then((data) => { is_getting_history = false; data.history.prices.forEach((price, idx) => { diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 4b47ac63f3..c361d3fab2 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.send({payout_currencies: 1}) + liveapi.cached.send({payout_currencies: 1}) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; @@ -882,7 +882,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.send({forget: id}); + id && liveapi.cached.send({forget: id}); }); } @@ -890,7 +890,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { let response; for (let i = 0; i < times_to_retry; i++) { try { - response = await liveapi.send(request); + response = await liveapi.cached.send(request); state.proposal.error = ''; state.proposal.id = response.proposal && response.proposal.id; break; @@ -986,7 +986,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { } try { const [tradeConf] = await require(['trade/tradeConf']); - const data = await liveapi.send({ + const data = await liveapi.cached.send({ buy: state.proposal.id, price: state.proposal.ask_price * 1, }); @@ -1108,7 +1108,7 @@ export function init(symbol, contracts_for, saved_template, isTrackerInitiated) if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.send({forget: id}); + id && liveapi.cached.send({forget: id}); }); } chartingRequestMap.unregister(key); diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index f14216cbb8..b4d9f47585 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -37,6 +37,7 @@ const refresh_active_symbols = () => { const trade = $("#nav-menu").find(".trade"); menu.refreshMenu(trade, markets, (symbol, display_name, pip) => { liveapi + .cached .send({ contracts_for: symbol }) .then((res) => { require(['trade/tradeDialog'], diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index fdb744e3e4..eacaa4400c 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -185,7 +185,7 @@ export const init = (contract_id, transaction_id) => { resolve(); return; } - liveapi.send({proposal_open_contract: 1, contract_id}) + liveapi.cached.send({proposal_open_contract: 1, contract_id}) .then((data) => { const proposal = data.proposal_open_contract; /* check for market data disruption error */ @@ -418,7 +418,7 @@ const init_dialog = (proposal) => { const sellAtMarket = (state, root) => { state.sell.sell_at_market_enabled = false; require(['text!viewtransaction/viewTransactionConfirm.html', 'css!viewtransaction/viewTransactionConfirm.css']); - liveapi.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) + liveapi.cached.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) .then((data) => { state.proposal_open_contract.is_sold_before_expiry = true; const { sell } = data; @@ -657,7 +657,7 @@ const setupChart = (state, root) => { // setup tick/candle stream for chart if (!state.proposal_open_contract.is_ended) updateLiveChart(state, granularity); - liveapi.send(tick_history_request) + liveapi.cached.send(tick_history_request) .then((data) => { onTickHistorySuccess(data); getContractData(state, state.proposal_open_contract); diff --git a/src/windows/tracker.es6 b/src/windows/tracker.es6 index 9ed4cc4404..2bcd1c1610 100644 --- a/src/windows/tracker.es6 +++ b/src/windows/tracker.es6 @@ -85,6 +85,7 @@ const reopen_dialogs = (symbols, saved_states) => { when_authenticated().then(() => { data.data.tracker_id = ++counter; liveapi + .cached .send({contracts_for: data.data.symbol.symbol}) .then((res) => { require(['trade/tradeDialog'], (tradeDialog) => { diff --git a/src/windows/windows.es6 b/src/windows/windows.es6 index 73b2839e36..ba9ff2773e 100644 --- a/src/windows/windows.es6 +++ b/src/windows/windows.es6 @@ -185,6 +185,7 @@ export const init = function($parentObj) { const pip = '0.001'; liveapi + .cached .send({ contracts_for: sym.symbol }) .then((res) => { // open chart window and tradeDialog From 0910cc2f57b53c9d41f0ba391df6a71f801fc30d Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Tue, 30 Apr 2019 10:31:37 +0800 Subject: [PATCH 2/8] update node-sass --- package-lock.json | 36 ++++++++---------------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa2759469c..ce49cd7806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5327,24 +5327,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, "logalot": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/logalot/-/logalot-2.1.0.tgz", @@ -5632,9 +5614,9 @@ "dev": true }, "nan": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", - "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==", + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "dev": true }, "nanomatch": { @@ -5713,9 +5695,9 @@ } }, "node-sass": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz", - "integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -5725,12 +5707,10 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.11", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", + "nan": "^2.13.2", "node-gyp": "^3.8.0", "npmlog": "^4.0.0", "request": "^2.88.0", diff --git a/package.json b/package.json index 08677ddea7..1ed7963a7b 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "grunt-shell": "^1.1.2", "grunt-text-replace": "^0.4.0", "lodash": "^4.17.5", - "node-sass": "^4.11.0" + "node-sass": "^4.12.0" }, "scripts": { "deploy-branch": "grunt deploy-branch", From 289344a7439b139bae60de22d1a0858a562f49c9 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:23:41 +0800 Subject: [PATCH 3/8] remove unnecessary cache --- src/cashier/deposit.es6 | 4 ++-- src/cashier/uk_funds_protection.es6 | 2 +- src/cashier/withdraw.es6 | 6 +++--- src/charts/chartingRequestMap.es6 | 2 +- src/copytrade/copytrade.es6 | 6 ++---- src/password/password.es6 | 2 +- src/portfolio/portfolio.es6 | 8 ++++---- src/realitycheck/realitycheck.es6 | 1 - src/selfexclusion/selfexclusion.es6 | 2 +- src/tc/tc.es6 | 2 +- src/token/token.es6 | 4 ++-- src/trade/tradeDialog.es6 | 6 +++--- 12 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/cashier/deposit.es6 b/src/cashier/deposit.es6 index 4bbed14378..771b254924 100644 --- a/src/cashier/deposit.es6 +++ b/src/cashier/deposit.es6 @@ -136,7 +136,7 @@ function init_state(root) { deposit_win_view = rv.bind(root[0], state); /* get the cashier_url */ - liveapi.cached.send({ + liveapi.send({ cashier: 'deposit' }).then(function(data) { state.user.cashier_url = data.cashier; @@ -165,7 +165,7 @@ function init_state(root) { residence_promise.then(function() { if (!state.user.residence) return { paymentagent_list: { list: [] } }; - return liveapi.cached.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); + return liveapi.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); }).then((data) => { const pa_list = data.paymentagent_list.list .map((agent) => { diff --git a/src/cashier/uk_funds_protection.es6 b/src/cashier/uk_funds_protection.es6 index 7ec4beed3c..64c022c78d 100644 --- a/src/cashier/uk_funds_protection.es6 +++ b/src/cashier/uk_funds_protection.es6 @@ -22,7 +22,7 @@ export const init_win = () => new Promise((resolve, reject) => { }); const state = {}; state.accept = () => { - liveapi.cached.send({ + liveapi.send({ "tnc_approval": 1, "ukgc_funds_protection": 1 }).then(resolve,reject).then(()=>{ diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index c10557883d..16b029f866 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -177,7 +177,7 @@ class Withdraw { } agent.hint = `Min: ${agent.min_amount} Max: ${agent.max_amount}`.i18n(); - liveapi.cached.send({ + liveapi.send({ verify_email: email, type: type }) @@ -283,7 +283,7 @@ class Withdraw { verification_code: verify.code }; agent.disabled = true; - liveapi.cached.send(request) + liveapi.send(request) .then(data => { route.update('agent-done') agent.disabled = false; @@ -308,7 +308,7 @@ class Withdraw { amount: transfer.amount }; transfer.disabled = true; - liveapi.cached.send(req) + liveapi.send(req) .then(data => { transfer.account = transfer.account.split("_to_")[1]; route.update('transfer-done'); diff --git a/src/charts/chartingRequestMap.es6 b/src/charts/chartingRequestMap.es6 index 9291879001..68e6375b0f 100644 --- a/src/charts/chartingRequestMap.es6 +++ b/src/charts/chartingRequestMap.es6 @@ -95,7 +95,7 @@ export const register = function(options) { map[key] = { symbol: options.symbol, granularity: granularity, subscribers: 0, chartIDs: [] }; if (req.subscribe) map[key].subscribers = 1; // how many charts have subscribed for a stream - return liveapi.cached.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout + return liveapi.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout .catch((up) => { /* if the market is closed try the same request without subscribing */ if (req.subscribe && up.code === 'MarketIsClosed') { diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 9469446a5c..24be5209f7 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -135,7 +135,6 @@ const state = { state.is_loading = true; liveapi - .cached .send({ set_settings: 1, allow_copiers, @@ -176,7 +175,6 @@ const state = { if (!settingsToSend.trade_types || settingsToSend.trade_types.length <= 0) delete settingsToSend.trade_types; liveapi - .cached .send(settingsToSend) .then(() => { newObj.disableStart = false; @@ -195,7 +193,7 @@ const state = { } } else { //Stop copying - liveapi.cached.send({ + liveapi.send({ copy_stop: state.traderTokens[index].yourCopySettings.copy_start }) .then(() => { @@ -214,7 +212,7 @@ const state = { const toBeRemovedItem = state.traderTokens[index]; state.traderTokens.splice(index, 1); updateLocalStorage(state); - liveapi.cached.send({ + liveapi.send({ copy_stop: toBeRemovedItem.yourCopySettings.copy_start }) .catch(e => {}); diff --git a/src/password/password.es6 b/src/password/password.es6 index e3f026193e..f689841c5d 100644 --- a/src/password/password.es6 +++ b/src/password/password.es6 @@ -95,7 +95,7 @@ const init_state = (root) => { new_password: state.account.new_password }; state.btn.disabled = true; - liveapi.cached.send(request) + liveapi.send(request) .then((data) =>{ if(data.change_password !== 1){ throw { message: 'Failed to update the password'.i18n()}; diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index a9d0cb3a46..daa7ec39a7 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -63,7 +63,7 @@ const proposalOpenContract = (command) => { if(command === 'subscribe') { ++subscribers; if(!subscribed_before && subscribers > 0) { - liveapi.cached.send({ proposal_open_contract: 1,subscribe: 1 }) + liveapi.send({ proposal_open_contract: 1,subscribe: 1 }) .then((data) => { subscribed_before = true; }) .catch((err) => { console.error(err); @@ -74,7 +74,7 @@ const proposalOpenContract = (command) => { else if(command === 'forget') { --subscribers; if(subscribed_before && subscribers === 0) { - liveapi.cached.send({ forget_all: 'proposal_open_contract' }) + liveapi.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; }) @@ -85,7 +85,7 @@ const proposalOpenContract = (command) => { } } else if( command === 'resubscribe' ) { - liveapi.cached.send({ forget_all: 'proposal_open_contract' }) + liveapi.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; --subscribers; @@ -262,7 +262,7 @@ const forget_the_contracts = (contracts) => { const init_table = async () => { const processing_msg = $('#' + table.attr('id') + '_processing').show(); try { - const data = await liveapi.cached.send({ portfolio: 1 }); + const data = await liveapi.send({ portfolio: 1 }); const contracts = (data.portfolio && data.portfolio.contracts); //|| [ // { diff --git a/src/realitycheck/realitycheck.es6 b/src/realitycheck/realitycheck.es6 index dbd2a0b916..1ab6496392 100644 --- a/src/realitycheck/realitycheck.es6 +++ b/src/realitycheck/realitycheck.es6 @@ -67,7 +67,6 @@ const setOrRefreshTimer = (timeOutInMins) => { const logoutAfter_ms = timeOutInMins * 60 * 1000; timerHandler = setTimeout(() => { liveapi - .cached .send({ reality_check : 1 }) .then((data) => { /* diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 00d5c93368..ed8afe0426 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -169,7 +169,7 @@ const settingsData = { } } - liveapi.cached.send(data) + liveapisend(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); diff --git a/src/tc/tc.es6 b/src/tc/tc.es6 index bdb207be05..053ac60a83 100644 --- a/src/tc/tc.es6 +++ b/src/tc/tc.es6 @@ -27,7 +27,7 @@ export const init = () => { const div = $(html).i18n(); div.find('.tc_landing_comp_name').html(landing_company_name); div.find('.button').click(() => { - liveapi.cached.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message + liveapi.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message win.dialog('destroy'); }); win = windows.createBlankWindow($('
'), { diff --git a/src/token/token.es6 b/src/token/token.es6 index 73ee59d4be..4d16b7b08b 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -152,7 +152,7 @@ const init_state = (root) => { } state.token.btn_disabled = true; - liveapi.cached.send(request).then((data) => { + liveapi.send(request).then((data) => { state.token.name = ''; state.token.btn_disabled = false; $.growl.notice({ message: `${'Successfully added new token '.i18n()} ${request.new_token}` }); @@ -170,7 +170,7 @@ const init_state = (root) => { } token_win_view = rv.bind(root[0], state); - return liveapi.cached.send({ api_token: 1 }) + return liveapi.send({ api_token: 1 }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index c361d3fab2..8903050530 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -882,7 +882,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.cached.send({forget: id}); + id && liveapi.send({forget: id}); }); } @@ -986,7 +986,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { } try { const [tradeConf] = await require(['trade/tradeConf']); - const data = await liveapi.cached.send({ + const data = await liveapi.send({ buy: state.proposal.id, price: state.proposal.ask_price * 1, }); @@ -1108,7 +1108,7 @@ export function init(symbol, contracts_for, saved_template, isTrackerInitiated) if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.cached.send({forget: id}); + id && liveapi.send({forget: id}); }); } chartingRequestMap.unregister(key); From 419be8e562781aee40b1aab92117c714455c647a Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:25:50 +0800 Subject: [PATCH 4/8] cache active symbols refresh --- src/cashier/withdraw.es6 | 2 +- src/trade/tradeMenu.es6 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 16b029f866..668c8c6f84 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -205,7 +205,7 @@ class Withdraw { if (menu.choice === 'standard') { verify.disabled = true; - liveapi.cached.send({ + liveapi.send({ cashier: 'withdraw', verification_code: verify.token }) diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index b4d9f47585..ee0e669e58 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -10,6 +10,7 @@ const show_error = (err) => { }; const refresh_active_symbols = () => { liveapi + .cached .send({ active_symbols: 'brief' }) .then((data) => { /* clean up the data! */ From 5197a8e1a825cf58854b85baf4d1eecae17bc0de Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:29:39 +0800 Subject: [PATCH 5/8] remove sell cached --- src/profittable/profitTable.es6 | 2 +- src/selfexclusion/selfexclusion.es6 | 2 +- src/statement/statement.es6 | 1 - src/token/token.es6 | 2 +- src/trade/tradeDialog.es6 | 2 +- src/viewtransaction/viewTransaction.es6 | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/profittable/profitTable.es6 b/src/profittable/profitTable.es6 index 517f6e1484..2e0133ff8b 100644 --- a/src/profittable/profitTable.es6 +++ b/src/profittable/profitTable.es6 @@ -91,7 +91,7 @@ const refreshTable = (yyyy_mm_dd) => { processing_msg.hide(); }; - liveapi.cached.send(request) + liveapi.send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index ed8afe0426..3b7dbdaad1 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -169,7 +169,7 @@ const settingsData = { } } - liveapisend(data) + liveapi.send(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); diff --git a/src/statement/statement.es6 b/src/statement/statement.es6 index 1283fe87cd..c9560ce194 100644 --- a/src/statement/statement.es6 +++ b/src/statement/statement.es6 @@ -85,7 +85,6 @@ const refreshTable = (yyy_mm_dd) => { if(!loading) { loading = true; liveapi - .cached .send(request) .then(refresh) .catch((err) => { diff --git a/src/token/token.es6 b/src/token/token.es6 index 4d16b7b08b..bb8104197b 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -96,7 +96,7 @@ const init_state = (root) => { state.confirm.yes = () => { const token = state.confirm.token; state.confirm.visible = false; - liveapi.cached.send({ api_token: 1, delete_token: token.token }) + liveapi.send({ api_token: 1, delete_token: token.token }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 8903050530..71b7012b56 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.cached.send({payout_currencies: 1}) + liveapi.cached.send({ payout_currencies: 1 }) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index eacaa4400c..912b88a2bc 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -418,7 +418,7 @@ const init_dialog = (proposal) => { const sellAtMarket = (state, root) => { state.sell.sell_at_market_enabled = false; require(['text!viewtransaction/viewTransactionConfirm.html', 'css!viewtransaction/viewTransactionConfirm.css']); - liveapi.cached.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) + liveapi.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) .then((data) => { state.proposal_open_contract.is_sold_before_expiry = true; const { sell } = data; From e29348eb59f25e57421556c7e7d84dc15812ed24 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 16:51:45 +0800 Subject: [PATCH 6/8] remove unnecessary cached --- src/accountstatus/accountstatus.es6 | 4 ++-- src/copytrade/copytrade.es6 | 1 - src/portfolio/portfolio.es6 | 4 ++-- src/selfexclusion/selfexclusion.es6 | 1 - src/trade/tradeDialog.es6 | 4 ++-- src/trade/tradeMenu.es6 | 1 - src/viewtransaction/viewTransaction.es6 | 2 +- src/windows/tracker.es6 | 1 - 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 98c9c0043b..c354b9325f 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -62,11 +62,11 @@ class AccountStatus { getStatus() { // Getting account status, website status, account settings and financial assessment. return Promise.all([ - liveapi.cached.send({ get_account_status: 1 }), + liveapi.send({ get_account_status: 1 }), liveapi.cached.send({ website_status: 1 }), liveapi.cached.send({ 'get_settings': 1 }), liveapi.cached.send({ get_financial_assessment: 1 }), - liveapi.cached.send({ mt5_login_list: 1 }) + liveapi.send({ mt5_login_list: 1 }) ]); } diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 24be5209f7..04062c1286 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -87,7 +87,6 @@ instrumentPromise().then(instruments => { const refreshTraderStats = (loginid, token, scope) => { return new Promise((resolve, reject) => { liveapi - .cached .send({ copytrading_statistics: 1, trader_id: loginid, diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index daa7ec39a7..fe09660288 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -157,7 +157,7 @@ const initPortfolioWin = () => { } }); - liveapi.cached.send({ balance: 1 }) + liveapi.send({ balance: 1 }) .then((data) => { currency = data.balance.currency; portfolioWin = windows.createBlankWindow($('
'), { @@ -183,7 +183,7 @@ const initPortfolioWin = () => { liveapi.events.off('transaction', on_transaction); }, refresh: () => { - liveapi.cached.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); + liveapi.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); forget_the_contracts(subscribed_contracts).then(init_table); } }); diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 3b7dbdaad1..35c0f2b3ca 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -237,7 +237,6 @@ function logoutBasedOnExcludeDateAndTimeOut() { const refreshData = function() { $.growl.notice({ message: 'Loading self-exclusion settings.'.i18n() }); return liveapi - .cached .send({ get_self_exclusion: 1 }) .then(function(response) { if (response.get_self_exclusion) { diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 71b7012b56..879686730c 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.cached.send({ payout_currencies: 1 }) + liveapi.send({ payout_currencies: 1 }) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; @@ -890,7 +890,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { let response; for (let i = 0; i < times_to_retry; i++) { try { - response = await liveapi.cached.send(request); + response = await liveapi.send(request); state.proposal.error = ''; state.proposal.id = response.proposal && response.proposal.id; break; diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index ee0e669e58..2a5dde0e10 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -38,7 +38,6 @@ const refresh_active_symbols = () => { const trade = $("#nav-menu").find(".trade"); menu.refreshMenu(trade, markets, (symbol, display_name, pip) => { liveapi - .cached .send({ contracts_for: symbol }) .then((res) => { require(['trade/tradeDialog'], diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index 912b88a2bc..71e35b18d6 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -185,7 +185,7 @@ export const init = (contract_id, transaction_id) => { resolve(); return; } - liveapi.cached.send({proposal_open_contract: 1, contract_id}) + liveapi.send({proposal_open_contract: 1, contract_id}) .then((data) => { const proposal = data.proposal_open_contract; /* check for market data disruption error */ diff --git a/src/windows/tracker.es6 b/src/windows/tracker.es6 index 2bcd1c1610..9ed4cc4404 100644 --- a/src/windows/tracker.es6 +++ b/src/windows/tracker.es6 @@ -85,7 +85,6 @@ const reopen_dialogs = (symbols, saved_states) => { when_authenticated().then(() => { data.data.tracker_id = ++counter; liveapi - .cached .send({contracts_for: data.data.symbol.symbol}) .then((res) => { require(['trade/tradeDialog'], (tradeDialog) => { From 662793243c3460c17263005b9b0b373388e483e6 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 16:53:51 +0800 Subject: [PATCH 7/8] remove contractfor cached --- src/cashier/withdraw.es6 | 2 +- src/windows/windows.es6 | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 668c8c6f84..76e616d599 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -354,7 +354,7 @@ class Withdraw { }) .catch(error_handler); - liveapi.cached.send({ payout_currencies: 1 }) + liveapi.send({ payout_currencies: 1 }) .then(data => { agent.currency = data.payout_currencies[0]; }).catch(err => console.error(err)); diff --git a/src/windows/windows.es6 b/src/windows/windows.es6 index ba9ff2773e..73b2839e36 100644 --- a/src/windows/windows.es6 +++ b/src/windows/windows.es6 @@ -185,7 +185,6 @@ export const init = function($parentObj) { const pip = '0.001'; liveapi - .cached .send({ contracts_for: sym.symbol }) .then((res) => { // open chart window and tradeDialog From aefc67cf0b61dfbba5222b9c6837d98d99ce6b05 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 6 May 2019 10:49:40 +0800 Subject: [PATCH 8/8] remove tick history request --- src/trade/tradeConf.es6 | 2 +- src/viewtransaction/viewTransaction.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trade/tradeConf.es6 b/src/trade/tradeConf.es6 index a4b98f4807..6a100f466b 100644 --- a/src/trade/tradeConf.es6 +++ b/src/trade/tradeConf.es6 @@ -258,7 +258,7 @@ const registerTicks = (state, extra) => { }); function getTickHistory(start, ticks_history) { - liveapi.cached.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) + liveapi.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) .then((data) => { is_getting_history = false; data.history.prices.forEach((price, idx) => { diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index 71e35b18d6..fdb744e3e4 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -657,7 +657,7 @@ const setupChart = (state, root) => { // setup tick/candle stream for chart if (!state.proposal_open_contract.is_ended) updateLiveChart(state, granularity); - liveapi.cached.send(tick_history_request) + liveapi.send(tick_history_request) .then((data) => { onTickHistorySuccess(data); getContractData(state, state.proposal_open_contract);