diff --git a/packages/web/components/place-limit-tool/index.tsx b/packages/web/components/place-limit-tool/index.tsx index 315052a7ea..d4a1365d84 100644 --- a/packages/web/components/place-limit-tool/index.tsx +++ b/packages/web/components/place-limit-tool/index.tsx @@ -44,7 +44,6 @@ import { countDecimals, trimPlaceholderZeros } from "~/utils/number"; export interface PlaceLimitToolProps { page: EventPage; - refetchOrders: () => Promise; } const fixDecimalCount = (value: string, decimalCount = 18) => { @@ -80,7 +79,7 @@ const NON_DISPLAY_ERRORS = [ ]; export const PlaceLimitTool: FunctionComponent = observer( - ({ page, refetchOrders }: PlaceLimitToolProps) => { + ({ page }: PlaceLimitToolProps) => { const { accountStore } = useStore(); const { t } = useTranslation(); const [reviewOpen, setReviewOpen] = useState(false); @@ -142,6 +141,7 @@ export const PlaceLimitTool: FunctionComponent = observer( type === "market" && swapState.priceState.percentAdjusted.abs().gt(new Dec(0)) ) { + console.log("RESETTING"); swapState.priceState.reset(); } }, [swapState.priceState, type]); @@ -611,7 +611,6 @@ export const PlaceLimitTool: FunctionComponent = observer( confirmAction={async () => { setIsSendingTx(true); await swapState.placeLimit(); - refetchOrders(); swapState.reset(); setAmountSafe("fiat", ""); setReviewOpen(false); diff --git a/packages/web/components/trade-tool/index.tsx b/packages/web/components/trade-tool/index.tsx index c2f2d8a995..fd57820277 100644 --- a/packages/web/components/trade-tool/index.tsx +++ b/packages/web/components/trade-tool/index.tsx @@ -15,7 +15,6 @@ import { } from "~/components/swap-tool/swap-tool-tabs"; import { EventName, EventPage } from "~/config"; import { useAmplitudeAnalytics, useTranslation } from "~/hooks"; -import { useOrderbookAllActiveOrders } from "~/hooks/limit-orders/use-orderbook"; import { useStore } from "~/stores"; export interface TradeToolProps { @@ -37,12 +36,6 @@ export const TradeTool: FunctionComponent = observer( const { accountStore } = useStore(); const wallet = accountStore.getWallet(accountStore.osmosisChainId); - const { orders, refetch } = useOrderbookAllActiveOrders({ - userAddress: wallet?.address ?? "", - pageSize: 10, - refetchInterval: 4000, - }); - useEffect(() => { switch (tab) { case SwapToolTab.BUY: @@ -74,21 +67,9 @@ export const TradeTool: FunctionComponent = observer( {useMemo(() => { switch (tab) { case SwapToolTab.BUY: - return ( - - ); + return ; case SwapToolTab.SELL: - return ( - - ); + return ; case SwapToolTab.SWAP: default: return ( @@ -100,7 +81,7 @@ export const TradeTool: FunctionComponent = observer( /> ); } - }, [page, swapToolProps, tab, refetch])} + }, [page, swapToolProps, tab])} {wallet?.isWalletConnected && ( { - if (limitSetPriceLock && orderType === "limit") limitSetPriceLock(isOpen); + if (limitSetPriceLock && orderType === "limit" && isOpen) + limitSetPriceLock(true); }, [limitSetPriceLock, isOpen, orderType]); const gasFeeError = useMemo(() => {