diff --git a/components/trade/TradingViewChart.tsx b/components/trade/TradingViewChart.tsx index 88145e0d..c2cfda3a 100644 --- a/components/trade/TradingViewChart.tsx +++ b/components/trade/TradingViewChart.tsx @@ -88,9 +88,10 @@ const TradingViewChart = () => { const selectedMarketName = mangoStore((s) => s.selectedMarket.current?.name) const isMobile = width ? width < breakpoints.sm : false - const defaultProps = useMemo( - () => ({ - symbol: selectedMarketName, + const defaultProps = useMemo(() => { + const initialMktName = mangoStore.getState().selectedMarket.current?.name + return { + symbol: initialMktName, interval: '60' as ResolutionString, theme: 'Dark', container: 'tv_chart_container', @@ -105,9 +106,8 @@ const TradingViewChart = () => { 'volume.volume.color.1': COLORS.UP[theme], 'volume.precision': 4, }, - }), - [theme, selectedMarketName] - ) + } + }, [theme]) const tvWidgetRef = useRef() const orderLinesButtonRef = useRef() diff --git a/store/mangoStore.ts b/store/mangoStore.ts index f5fce086..6e92066c 100644 --- a/store/mangoStore.ts +++ b/store/mangoStore.ts @@ -328,7 +328,7 @@ const mangoStore = create()( details: { profile_name: '', trader_category: '', wallet_pk: '' }, }, selectedMarket: { - name: '', + name: 'SOL/USDC', current: undefined, fills: [], bidsAccount: undefined,