Skip to content

Commit

Permalink
chore: get rid of maxFromValue
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w committed Dec 18, 2024
1 parent 24ba6ae commit 3223b37
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/pages/Swap/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export function Swap() {
swapWarning,
isReversed,
toTokenValue,
maxFromValue,
optimalRate,
destAmount,
} = useSwapStateFunctions();
Expand Down Expand Up @@ -128,11 +127,6 @@ export function Swap() {
return result;
}, [destAmount, destinationInputField, toTokenValue]);

const maxFromAmount = useMemo(() => {
if (isLoading || destinationInputField === 'to') return undefined;
if (destinationInputField === 'from') return maxFromValue ?? 0n;
}, [destinationInputField, isLoading, maxFromValue]);

async function performSwap() {
const {
amount,
Expand Down Expand Up @@ -258,7 +252,6 @@ export function Swap() {
setIsToTokenSelectOpen(false);
}}
tokensList={tokensWBalances}
maxAmount={maxFromAmount}
skipHandleMaxAmount
isOpen={isFromTokenSelectOpen}
selectedToken={selectedFromToken}
Expand Down
3 changes: 0 additions & 3 deletions src/pages/Swap/hooks/useSwapStateFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function useSwapStateFunctions() {
const [defaultFromValue, setFromDefaultValue] = useState<bigint>();
const [fromTokenValue, setFromTokenValue] = useState<Amount>();
const [toTokenValue, setToTokenValue] = useState<Amount>();
const [maxFromValue, setMaxFromValue] = useState<bigint | undefined>();

const {
setValuesDebouncedSubject,
Expand Down Expand Up @@ -98,7 +97,6 @@ export function useSwapStateFunctions() {
}
: AVAX;
setSelectedFromToken(historyFromToken);
setMaxFromValue(historyFromToken?.balance);
const historyToToken = pageHistory.selectedToToken
? {
...pageHistory.selectedToToken,
Expand Down Expand Up @@ -336,7 +334,6 @@ export function useSwapStateFunctions() {
swapWarning,
isReversed,
toTokenValue,
maxFromValue,
optimalRate,
destAmount,
getSwapValues,
Expand Down

0 comments on commit 3223b37

Please sign in to comment.