Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Dec 17, 2024
1 parent 249b46f commit 0873902
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions apps/wallet-mobile/src/features/Swap/common/SwapProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ export const SwapProvider = ({children}: {children: React.ReactNode}) => {
const wantedPriceInputRef = React.useRef<TextInput | null>(null)
const slippageInputRef = React.useRef<TextInput | null>(null)

/*
const hasTokenInBalance = balances.records.get(tokenIn)?.quantity ?? 0n >= tokenInAmount
const isSellPt = orderData.amounts.sell?.info.id === wallet.portfolioPrimaryTokenInfo.id
const ptTotalRequired = orderData.selectedPoolCalculation?.cost.ptTotalRequired.quantity ?? 0n
const hasPtBalance = primaryTokenBalance >= (!isSellPt ? 0n : sellQuantity + ptTotalRequired)
*/
const [state, dispatch] = React.useReducer(swapReducer, defaultState)

React.useEffect(() => {
Expand Down Expand Up @@ -161,14 +154,19 @@ export const SwapProvider = ({children}: {children: React.ReactNode}) => {
})
}, [
navigate,
state.estimate?.splits,
state.estimate?.totalFee,
state.orderType,
state.selectedDex.value,
state.slippageInput.value,
state.tokenInInput.tokenId,
state.tokenInInput.value,
state.tokenOutInput.tokenId,
state.tokenOutInput.value,
state.wantedPrice,
swapManager.api,
tokenInfos,
track,
])

const context = React.useMemo(
Expand Down

0 comments on commit 0873902

Please sign in to comment.