diff --git a/www/js/pages/trade/components/chart/chart.controller.js b/www/js/pages/trade/components/chart/chart.controller.js index 0da3b6fda3..bd09cd9f71 100644 --- a/www/js/pages/trade/components/chart/chart.controller.js +++ b/www/js/pages/trade/components/chart/chart.controller.js @@ -22,9 +22,9 @@ $scope.$on("portfolio", (e, portfolio) => { const contractId = vm.purchasedContract.contractId; - if (!_.isEmpty(contractId)) { + if ((typeof contractId === "string" && !_.isEmpty(contractId)) || contractId) { portfolio.contracts.forEach(contract => { - if (contract.contract_id.toString() === contractId) { + if ((typeof contractId === "string" && contract.contract_id.toString() === contractId) || contract.contract_id === contractId) { chartService.addContract({ startTime: contract.date_start + 1, duration : parseInt(vm.proposal.duration), diff --git a/www/js/pages/trade/proposal.service.js b/www/js/pages/trade/proposal.service.js index e120595fd1..234e5362b9 100644 --- a/www/js/pages/trade/proposal.service.js +++ b/www/js/pages/trade/proposal.service.js @@ -71,7 +71,7 @@ const options = JSON.parse(localStorage.options); const proposal = create(); proposal.symbol = options.underlying.symbol; - proposal.duration = options.tick; + proposal.duration = parseInt(options.tick); if (options.tradeType === "Higher/Lower") { proposal.barrier = _.isEmpty(options.barrier) ? "" : options.barrier; } else { @@ -120,7 +120,7 @@ } proposal.symbol = options.underlying.symbol; - proposal.duration = options.tick; + proposal.duration = parseInt(options.tick); if (options.tradeType === "Higher/Lower") { proposal.barrier = _.isEmpty(options.barrier) ? "" : options.barrier; } else {