Skip to content

Commit

Permalink
v3.1.1
Browse files Browse the repository at this point in the history
v3.1.1
  • Loading branch information
platschi authored Aug 19, 2022
2 parents 0daa3ee + 5411121 commit 22f2808
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hooks/useExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ const useExchange = ({

const txProvider: TxProvider | null = useMemo(() => {
if (!baseCurrencyKey || !quoteCurrencyKey) return null;
if (synthTokensMap[baseCurrencyKey] && synthTokensMap[quoteCurrencyKey]) return 'synthetix';
if (synthsMap[baseCurrencyKey] && synthsMap[quoteCurrencyKey]) return 'synthetix';
if (oneInchTokensMap?.[baseCurrencyKey] && oneInchTokensMap?.[quoteCurrencyKey]) return '1inch';
return 'synthswap';
}, [baseCurrencyKey, quoteCurrencyKey, synthTokensMap, oneInchTokensMap]);
}, [synthsMap, baseCurrencyKey, quoteCurrencyKey, oneInchTokensMap]);

// TODO: these queries break when `txProvider` is not `synthetix` and should not be called.
// however, condition would break rule of hooks here
Expand Down Expand Up @@ -285,7 +285,7 @@ const useExchange = ({
if (currencyKey != null) {
if (isETH) {
return ETHBalance;
} else if (synthTokensMap[currencyKey]) {
} else if (synthsMap[currencyKey]) {
return synthsWalletBalance != null
? (get(synthsWalletBalance, ['balancesMap', currencyKey, 'balance'], zeroBN) as Wei)
: null;
Expand All @@ -295,7 +295,7 @@ const useExchange = ({
}
return null;
},
[ETHBalance, synthsWalletBalance, tokenBalances, synthTokensMap]
[synthsMap, ETHBalance, synthsWalletBalance, tokenBalances]
);

const quoteCurrencyBalance = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kwenta",
"version": "3.1.0",
"version": "3.1.1",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion sections/exchange/MobileSwap/SwapButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SwapButton: React.FC = () => {
>
{!!submissionDisabledReason
? submissionDisabledReason
: !isApproved
: needsApproval && !isApproved
? t('exchange.summary-info.button.approve')
: t('exchange.summary-info.button.submit-order')}
</Button>
Expand Down

1 comment on commit 22f2808

@vercel
Copy link

@vercel vercel bot commented on 22f2808 Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./

kwenta.io
kwenta-git-main-kwenta.vercel.app
v2.beta.kwenta.io
kwenta-kwenta.vercel.app

Please sign in to comment.