Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit e004658

Browse files
committed
Fixed edge-case: Pip sizing still required for tick stream or history
1 parent 8eaa6b0 commit e004658

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/javascript/app/pages/trade/tick_trade.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const HighchartUI = require('./charts/highchart.ui');
33
const requireHighstock = require('./common').requireHighstock;
44
const countDecimalPlaces = require('./common_independent').countDecimalPlaces;
55
const Reset = require('./reset');
6+
const getUnderlyingPipSize = require('./symbols').getUnderlyingPipSize;
67
const Tick = require('./tick');
78
const updatePurchaseStatus = require('./update_values').updatePurchaseStatus;
89
const ViewPopupUI = require('../user/view_popup/view_popup.ui');
@@ -303,7 +304,7 @@ const TickDisplay = (() => {
303304
applicable_ticks = [];
304305
};
305306

306-
const dispatch = (data) => {
307+
const dispatch = async (data) => {
307308
const tick_chart = CommonFunctions.getElementById(id_render);
308309

309310
if (!CommonFunctions.isVisible(tick_chart) || !data || (!data.tick && !data.history)) {
@@ -322,7 +323,9 @@ const TickDisplay = (() => {
322323
if (document.getElementById('sell_content_wrapper')) {
323324
if (!chart_display_decimals) {
324325
// We're getting the pip size based on standard `display_value` provided by API
325-
chart_display_decimals = countDecimalPlaces(contract.display_value);
326+
chart_display_decimals = countDecimalPlaces(contract.display_value) ||
327+
data.history ? await getUnderlyingPipSize(data.echo_req.ticks_history)
328+
: data.tick ? await getUnderlyingPipSize(data.echo_req.ticks) : Tick.pipSize();
326329
}
327330
if (data.tick) {
328331
Tick.details(data);

0 commit comments

Comments
 (0)