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

amam/bid_price_error_fix #1401

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions src/viewtransaction/viewTransaction.es6
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ const updateIndicative = (data, state) => {
return;
}

updateStateSell();
handleForwardStarting();
updateStateSell(contract, state);
handleForwardStarting(contract, state);
state.chart.manualReflow();

function updateState(contract, state) {
Expand All @@ -249,14 +249,14 @@ const updateIndicative = (data, state) => {
state.note = makeNote(contract);
}

function updateStateSell() {
function updateStateSell(contract, state) {
if (contract.bid_price) {
state.sell.bid_price.value = contract.bid_price;
[state.sell.bid_price.unit, state.sell.bid_price.cent] = contract.bid_price.toString().split(/[\.,]+/);
[state.sell.bid_price.unit, state.sell.bid_price.cent] = String(contract.bid_price).split(/[\.,]+/);
}
}

function handleForwardStarting() {
function handleForwardStarting(contract, state) {
const constract_is_forward_starting = contract.is_forward_starting && +contract.date_start > +contract.current_spot_time;
if (constract_is_forward_starting) {
state.fwd_starting = '* Contract has not started yet'.i18n();
Expand Down