Skip to content

Commit

Permalink
fix hooks for swap
Browse files Browse the repository at this point in the history
  • Loading branch information
webdev403 committed Mar 21, 2024
1 parent 7b2b6b8 commit cb35856
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/state/swap/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ export function useDerivedSwapInfo(): {
const { account, chainId } = useActiveWeb3React();
const chainIdToUse = chainId ?? ChainId.MATIC;
const parsedQuery = useParsedQueryString();
const swapType = parsedQuery ? parsedQuery.swapIndex : undefined;
const swapType = parsedQuery?.swapIndex;
const swapSlippage = parsedQuery?.slippage
? (parsedQuery.slippage as string)
? (parsedQuery?.slippage as string)
: undefined;

const {
Expand Down
4 changes: 2 additions & 2 deletions src/state/swap/v3/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ export function useDerivedSwapInfo(): {
}

const parsedQs = useParsedQueryString();
const swapSlippage = parsedQs.slippage
? (parsedQs.slippage as string)
const swapSlippage = parsedQs?.slippage
? (parsedQs?.slippage as string)
: undefined;
useEffect(() => {
const stableCoins = GlobalData.stableCoins[chainIdToUse];
Expand Down

0 comments on commit cb35856

Please sign in to comment.