From 42daf48fa667dbe0b2c6f3b7ca9a7c2bfd52f7e7 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 22 May 2022 03:07:31 +0800 Subject: [PATCH] backtest report: fix default interval issue --- apps/backtest-report/components/TradingViewChart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/backtest-report/components/TradingViewChart.js b/apps/backtest-report/components/TradingViewChart.js index 56a7791f1..69ac37037 100644 --- a/apps/backtest-report/components/TradingViewChart.js +++ b/apps/backtest-report/components/TradingViewChart.js @@ -331,8 +331,8 @@ const TradingViewChart = (props) => { const chartContainerRef = useRef(); const chart = useRef(); const resizeObserver = useRef(); - const [currentInterval, setCurrentInterval] = useState('5m'); const intervals = props.reportSummary.intervals || []; + const [currentInterval, setCurrentInterval] = useState(intervals.length > 0 ? intervals[0] : '1m'); useEffect(() => { if (!chartContainerRef.current || chartContainerRef.current.children.length > 0) {