Skip to content

Commit

Permalink
🐛 bugfix(Swap): LLM - Swap buttons not available on Currency and acco…
Browse files Browse the repository at this point in the history
…unt screens (#1533)

* 🐛 bugfix(Swap): LLM - Swap buttons not available on Currency and account screens

* 📝 Changeset

* lint
  • Loading branch information
mcayuelas-ledger committed Oct 17, 2022
1 parent df98cef commit 107e9cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-peas-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

LLM - Swap buttons not available on Currency and account screens
13 changes: 11 additions & 2 deletions apps/ledger-live-mobile/src/screens/Swap/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ import {
flattenAccounts,
accountWithMandatoryTokens,
} from "@ledgerhq/live-common/account/index";
import { getSwapSelectableCurrencies } from "@ledgerhq/live-common/lib/exchange/swap/logic";
import { shallowAccountsSelector } from "../../../reducers/accounts";
import {
swapAcceptedProvidersSelector,
swapKYCSelector,
} from "../../../reducers/settings";
import { setSwapKYCStatus } from "../../../actions/settings";
import {
setSwapKYCStatus,
setSwapSelectableCurrencies,
} from "../../../actions/settings";
import {
providersSelector,
rateSelector,
Expand Down Expand Up @@ -58,7 +62,12 @@ export const useProviders = () => {
const { providers, error: providersError } = useSwapProviders();

useEffect(() => {
if (providers) dispatch(updateProvidersAction(providers));
if (providers) {
dispatch(updateProvidersAction(providers));
dispatch(
setSwapSelectableCurrencies(getSwapSelectableCurrencies(providers)),
);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [providers]);

Expand Down

0 comments on commit 107e9cf

Please sign in to comment.