diff --git a/apps/trading/client-pages/market/market.tsx b/apps/trading/client-pages/market/market.tsx index bc649619a..88f004b33 100644 --- a/apps/trading/client-pages/market/market.tsx +++ b/apps/trading/client-pages/market/market.tsx @@ -3,7 +3,7 @@ import { addDecimalsFormatNumber, titlefy } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; import { useScreenDimensions } from '@vegaprotocol/react-helpers'; import { useThrottledDataProvider } from '@vegaprotocol/data-provider'; -import { AsyncRenderer, ExternalLink, Splash } from '@vegaprotocol/ui-toolkit'; +import { ExternalLink, Loader, Splash } from '@vegaprotocol/ui-toolkit'; import { getAsset, marketDataProvider, useMarket } from '@vegaprotocol/markets'; import { useGlobalStore, usePageTitleStore } from '../../stores'; import { TradeGrid } from './trade-grid'; @@ -68,7 +68,7 @@ export const MarketPage = ({ closed }: { closed?: boolean }) => { const update = useGlobalStore((store) => store.update); const lastMarketId = useGlobalStore((store) => store.marketId); - const { data, error, loading } = useMarket(marketId); + const { data, loading } = useMarket(marketId); useEffect(() => { if ( @@ -110,7 +110,15 @@ export const MarketPage = ({ closed }: { closed?: boolean }) => { } }, [largeScreen, data, pinnedAsset]); - if (!data && marketId) { + if (loading) { + return ( + + + + ); + } + + if (!data) { return ( @@ -120,7 +128,7 @@ export const MarketPage = ({ closed }: { closed?: boolean }) => {

{t(`Please choose another market from the`)}{' '} navigate(Links.MARKETS())}> - market list + {t('market list')}

@@ -129,18 +137,13 @@ export const MarketPage = ({ closed }: { closed?: boolean }) => { } return ( - false} - > + <> {tradeView} - + ); };