Skip to content

Commit

Permalink
improved backtest progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroshch committed Sep 21, 2023
1 parent 2a549d7 commit 7c271cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/components/BacktestProgressBar/BacktestProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ const BacktestProgressBar = ({ percent, startedOn }) => {

BacktestProgressBar.propTypes = {
percent: PropTypes.number.isRequired,
startedOn: PropTypes.number,
}

BacktestProgressBar.defaultProps = {
startedOn: new Date().getTime(),
startedOn: PropTypes.number.isRequired,
}

export default BacktestProgressBar
3 changes: 2 additions & 1 deletion src/components/StrategyEditor/tabs/BacktestTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const BacktestTab = (props) => {
gid,
results,
} = backtestState

const { id: strategyId } = strategy
const positions = results?.strategy?.closedPositions

Expand Down Expand Up @@ -216,7 +217,7 @@ const BacktestTab = (props) => {
{!showBacktestResults && (
<div className='hfui-strategyeditor__backtest-tab-empty'>
{loading ? (
<BacktestProgressBar percent={progressPerc} startedOn={gid} />
<BacktestProgressBar percent={progressPerc} startedOn={gid || Date.now()} />
) : (
<p className='hfui-strategyeditor__initial-message'>
{t(getInitialMessageI18Key(activeSection))}
Expand Down

0 comments on commit 7c271cb

Please sign in to comment.