improve selection via deconstructor

This commit is contained in:
c9s 2022-05-18 02:08:24 +08:00
parent f3f6e4e68b
commit f9a1d37d63
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -392,6 +392,7 @@ const TradingViewChart = (props) => {
chart.current.timeScale().fitContent();
return () => {
chart.current.remove();
setData(null);
};
}, [props.runID, currentInterval, data])
@ -421,8 +422,6 @@ const TradingViewChart = (props) => {
{intervals.map((interval) => {
return <Button size="xs" key={interval} onPress={(e) => {
setCurrentInterval(interval)
setData(null);
setMarkers(null);
}}>
{interval}
</Button>