Skip to content

Commit

Permalink
refactor data
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Sep 24, 2023
1 parent 757e5e3 commit 4caa603
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/swapv2/LimitOrder/LimitOrderForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ function LimitOrderForm({
}

const parseInputAmount = tryParseAmount(inputAmount, currencyIn ?? undefined)
const { data, isError } = useGetLOConfigQuery(chainId)
const limitOrderContract = isError ? undefined : data?.contract || undefined
const { currentData } = useGetLOConfigQuery(chainId)
const limitOrderContract = currentData?.contract

const currentAllowance = useTokenAllowance(
currencyIn as Token,
Expand Down
4 changes: 2 additions & 2 deletions src/components/swapv2/LimitOrder/useCancellingOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function useCancellingOrders(): CancellingOrderInfo {
const [cancellingOrdersIds, setCancellingOrdersIds] = useState<number[]>([])
const [cancellingOrdersNonces, setCancellingOrdersNonces] = useState<OrderNonces>({})
const [loading, setLoading] = useState(true)
const { data, isError } = useGetLOConfigQuery(chainId)
const contract = isError ? '' : data?.contract || ''
const { currentData } = useGetLOConfigQuery(chainId)
const contract = currentData?.contract || ''

const setCancellingOrders = useCallback((orderIds: number[]) => {
setCancellingOrdersIds(orderIds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useActiveWeb3React } from 'hooks'

export const useIsSupportSoftCancelOrder = () => {
const { chainId } = useActiveWeb3React()
const { data: config } = useGetLOConfigQuery(chainId)
const { currentData: config } = useGetLOConfigQuery(chainId)
return useCallback(
(order: LimitOrder | undefined) => {
if (!order) return false
Expand Down

0 comments on commit 4caa603

Please sign in to comment.