Skip to content

Commit

Permalink
Merge branch 'master' into redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Jul 18, 2024
2 parents 361a172 + c3f0ad9 commit 35477b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
13 changes: 10 additions & 3 deletions src/javascript/app/pages/trade/charts/digit_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const getHighstock = require('../common').requireHighstock;
const Defaults = require('../defaults');
const Symbols = require('../symbols');
const BinarySocket = require('../../../base/socket');
const { getElementById } = require('../../../../_common/common_functions');
const getSymbolsForMarket = require('../../../common/active_symbols').getSymbolsForMarket;
const addComma = require('../../../../_common/base/currency_base').addComma;
const localize = require('../../../../_common/localize').localize;
Expand Down Expand Up @@ -129,7 +130,7 @@ const DigitInfo = (() => {
count,
};
if (chart.series[0].name !== symbol) {
if ($('#underlying').find('option:selected').val() !== $('#digit_underlying').val()) {
if (getElementById('underlying').value !== $('#digit_underlying').val()) {
request.subscribe = 1;
request.style = 'ticks';
}
Expand Down Expand Up @@ -245,15 +246,21 @@ const DigitInfo = (() => {
};

const updateChart = async (tick) => {
if (typeof chart === 'undefined') {
return;
}

const decimal_places = await Symbols.getUnderlyingPipSize(tick.tick.symbol);
if (stream_id) {
if (chart.series[0].name === tick.tick.symbol) {
stream_id = tick.tick.id || null;
update(tick.tick.symbol, tick.tick.quote);
update(tick.tick.symbol, addComma(tick.tick.quote, decimal_places).replace(',', ''));
} else {
BinarySocket.send({ forget: (tick.tick.id).toString() });
BinarySocket.send({ forget: (stream_id).toString() });
stream_id = null;
}
} else {
stream_id = tick.tick.id || null;
update(tick.tick.symbol, addComma(tick.tick.quote, decimal_places).replace(',', ''));
}
};
Expand Down
20 changes: 11 additions & 9 deletions src/javascript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
*
*/
const domain_app_ids = { // these domains also being used in '_common/url.js' as supported "production domains"
'binary.com' : 1,
'smarttrader.deriv.app' : 22168,
'smarttrader.deriv.com' : 22168,
'smarttrader.deriv.me' : 27315,
'smarttrader.deriv.be' : 31224,
'staging-smarttrader.deriv.be': 31191,
'binary.me' : 15284,
'deriv.com' : 16929,
'binary.com' : 1,
'smarttrader.deriv.app' : 22168,
'smarttrader.deriv.com' : 22168,
'smarttrader.deriv.me' : 27315,
'smarttrader.deriv.be' : 31224,
'staging-smarttrader.deriv.be' : 31191,
'staging-smarttrader.deriv.com': 22169,
'binary.me' : 15284,
'deriv.com' : 16929,
};

const getCurrentBinaryDomain = () =>
Expand Down Expand Up @@ -106,7 +107,8 @@ const getSocketURL = () => {

const loginid = window.localStorage.getItem('active_loginid');
const is_real = loginid && !/^VRT/.test(loginid);
const server = isProduction() && is_real ? 'green' : 'red';
const real_server = is_real ? 'green' : 'blue';
const server = isProduction() ? real_server : 'red';

server_url = `${server}.derivws.com`;
}
Expand Down

0 comments on commit 35477b9

Please sign in to comment.